[Rd] proto and baseenv()

Ben misc7 at emerose.org
Fri Feb 26 02:49:19 CET 2010

> I think you are looking for a different object model than proto
> offers.  There aren't many languages that offer the prototype object
> model.

Yes, your probably right---I don't have much experience using the
prototype model.  This is the way I expected it to work:

> z <- 1
> p <- proto(expr={a <- z})
> p$a
[1] 1
> p$z
Error in get(x, env = this, inherits = inh) : variable "z" was not found

Also it seems it would lead to fewer bugs if it worked that way.
(Peter Danenberg mentions he's run into bugs because of this, and I
can see why.)  But as I mentioned I'm new to prototype programming.
If it worked like in my snippet, would this lead to less effective
prototype programming?



More information about the R-devel mailing list