[Rd] The default behaviour of a missing entry in an environment

Trishank Karthik Kuppusamy tk47 at nyu.edu
Fri Nov 13 21:50:54 CET 2009

Hello Henrik,

On Nov 13, 2009, at 3:42 PM, Henrik Bengtsson wrote:

> If you develop your own code you can add your own behavior by
> "extending" the environment class.  I put "extending" in quotation
> marks, because 'environment' is one of few classes you should *not*
> extend from in the regular S3 (and S4?) sense, at least that was the
> case a few years ago.  You can search the r-devel list about issues
> when trying to do so.  One thing I remember is that it didn't work
> well to save such objects.  Bla bla bla, there are workarounds for it
> and the Object class in the R.oo package is one.  Here is how you can
> add your protection for your own environment-like objects:

I like this solution! (As well as the name of the picky object.)
If the environment class can be properly subclassed,
then everything should work in principle. Thanks for the tip.


More information about the R-devel mailing list