From tk47 at nyu.edu  Fri Nov 13 21:50:54 2009
From: tk47 at nyu.edu (Trishank Karthik Kuppusamy)
Date: Fri, 13 Nov 2009 15:50:54 -0500
Subject: [Rd] The default behaviour of a missing entry in an environment
In-Reply-To: <59d7961d0911131242o1f070660m7fbe75f8501e1276@mail.gmail.com>
References: <D737F65B-A317-44C1-8421-E8DE2D0E0740@nyu.edu>
	<4AFDB33D.5010607@stats.uwo.ca>
	<39831344-CF89-4D0C-9804-702B80D4DE4C@nyu.edu>
	<4AFDB7DA.3080104@stats.uwo.ca>
	<6BB98E4A-8539-4C69-B754-2180AC6D7369@nyu.edu>
	<59d7961d0911131242o1f070660m7fbe75f8501e1276@mail.gmail.com>
Message-ID: <75916416-7304-411D-BEFE-CE20583AB8E6@nyu.edu>

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.

-Trishank



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