From jmc4 at stanford.edu  Wed Oct 20 19:21:24 2010
From: jmc4 at stanford.edu (John Chambers)
Date: Wed, 20 Oct 2010 10:21:24 -0700
Subject: [Rd] new.env does not recognize parents from subclasses
	of	"environment"
In-Reply-To: <cpnwrpdgod9.fsf@gmail.com>
References: <cpnwrpdgod9.fsf@gmail.com>
Message-ID: <4CBF2514.8050409@stanford.edu>

  Thanks for the report.  Should now be fixed in r-devel and 2.12 
patched (rev 53383).

Please do report any cases where a subclass of environment doesn't 
work.  There are some known cases in locking and active binding, that 
will be fixed in due course.

The workaround for any such problem is usually as.environment().

On 10/20/10 3:17 AM, Vitaly S. wrote:
> Dear Developers,
>
> A lot has been changed in the R12.0 with respect to behavior of "environment"
> subclasses.  Many thanks for that.
>
> One small irregularity, though; new.env does not allow the parent to be from S4
> subclass.
>
>
>> setClass("myenv", contains="environment")
> [1] "myenv"
>> new.env(parent=new("myenv"))
> Error in new.env(parent = new("myenv")) : 'enclos' must be an environment
>
> I wonder if this is a "planed" behavior.
>
> The use of .xData  slot obviously works:
>> new.env(parent=new("myenv")@.xData)
> <environment: 063bb9e8>
> Thanks,
> Vitaly.
>
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>



[Rd] new.env does not recognize parents from subclasses of "environment"
John Chambers