Re: [R-pkg-devel] Visible bindings and reference classes

2015-08-11 Thread luke-tierney
On Tue, 11 Aug 2015, William Dunlap wrote: You can avoid the temporary file by replacing dput(def, file= (tf <- tempfile())) compiler::cmpfile(tf) with cdef <- compiler::compile(def) #Note: no visible binding for '<<-' assignment to 'ConfigString' The compiled code appears to work. eval(cde

Re: [R-pkg-devel] Visible bindings and reference classes

2015-08-11 Thread luke-tierney
On Tue, 11 Aug 2015, Colin Gillespie wrote: To your question: Reference classes are used in *many* places, and the use of ' <<- ' is really "standard" there. e.g., package 'lme4', or 'pcalg' are two packages I'm involved with, which use ref.classes and ' <<- ' but are "fine" with that. So

Re: [R-pkg-devel] Visible bindings and reference classes

2015-08-11 Thread William Dunlap
You can avoid the temporary file by replacing dput(def, file= (tf <- tempfile())) compiler::cmpfile(tf) with cdef <- compiler::compile(def) #Note: no visible binding for '<<-' assignment to 'ConfigString' The compiled code appears to work. eval(cdef) c1 <- Config$new() c1 #Reference

Re: [R-pkg-devel] Visible bindings and reference classes

2015-08-11 Thread William Dunlap
This is a problem in the compiler package. Here is a way to reproduce it: def <- quote(Config <- setRefClass("Config", fields = list( ConfigString = "character"), methods = list( # Constructor initialize = function() { ConfigString <<- "Hello, World!"

Re: [R-pkg-devel] Visible bindings and reference classes

2015-08-11 Thread Colin Gillespie
> > > To your question: > > Reference classes are used in *many* places, and the use of ' <<- ' > is really "standard" there. > e.g., package 'lme4', or 'pcalg' are two packages I'm involved with, > which use ref.classes and ' <<- ' but are "fine" with that. > > So there must be something peculi

Re: [R-pkg-devel] Visible bindings and reference classes

2015-08-11 Thread Martin Maechler
> Colin Gillespie > on Mon, 10 Aug 2015 20:33:32 + writes: > Dear All, > > I have a package that uses reference classes. When I build the package I > get numerous notes of the sort > > Note: no visible binding for '<<-' assignment to 'pars' > > I've tried using GlobalVariables,