Skip to content
Prev 9166 / 398502 Next

Object orientation?

I expect you could do something like

 let(MyO, ThisProperty = ThisValue)

with a declaration for the function like this:

  let <- function(obj, ...)
  {
     properties <- list(...)
     assign( something, envir = something)
  }

and playing around with the sys.frame function, substitute, etc., to
fill in the gaps. I think the details are in the R extensions manual.
Look at 

 get("mode<-")

for an example of a function call constructed from the arguments, and
an assignment made in a parent frame.

Duncan Murdoch
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._