Skip to content
Back to formatted view

Raw Message

Message-ID: <3a74ee30.67494892@fisher.stats.uwo.ca>
Date: 2001-01-24T15:14:51Z
From: Duncan Murdoch
Subject: Object orientation?
In-Reply-To: <NEBBJKDJHEFCOOLFFAKKOEJJCAAA.cyg@sympatico.ca>

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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._