new.env does not recognize parents from subclasses of "environment"

classic Classic list List threaded Threaded
15 messages Options
Reply | Threaded
Open this post in threaded view
|

new.env does not recognize parents from subclasses of "environment"

Vitalie S.-2

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.

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Reply | Threaded
Open this post in threaded view
|

Re: new.env does not recognize parents from subclasses of "environment"

John Chambers
  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.
>
> ______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Reply | Threaded
Open this post in threaded view
|

Re: new.env does not recognize parents from subclasses of "environment"

Vitalie S.-2


Here is an infinite recursion error  which occurs only with S4
subclasses assignment.

 setClass("myenv", contains = "environment")
#[1] "myenv"
 env <- new("myenv")
 env[[".me"]] <- env@.xData
#Error: evaluation nested too deeply: infinite recursion / options(expressions=)?
 

With basic types it works as expected:

env1 <- new.env()
env1[[".me"]] <- env1

May be this is related to active bindings that you mentioned,  but I am still
reporting it here.

Vitally.


>  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.
>>
>> ______________________________________________
>> [hidden email] mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-devel>

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Reply | Threaded
Open this post in threaded view
|

Re: new.env does not recognize parents from subclasses of "environment"

Vitalie S.-2
In reply to this post by John Chambers


Here is an infinite recursion error  which occurs only with S4
subclasses assignment.

 setClass("myenv", contains = "environment")
#[1] "myenv"
 env <- new("myenv")
 env[[".me"]] <- env@.xData
#Error: evaluation nested too deeply: infinite recursion / options(expressions=)?
 

With basic types it works as expected:

env1 <- new.env()
env1[[".me"]] <- env1

May be this is related to active bindings that you mentioned,  but I am still
reporting it here.

Vitally.


>  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.
>>
>> ______________________________________________
>> [hidden email] mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-devel>

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Reply | Threaded
Open this post in threaded view
|

Re: new.env does not recognize parents from subclassesof "environment"

William Dunlap
The traceback looks very similar to a problem
in R 2.11.1 reported earlier this month by Troy Robertson.
  > From: [hidden email]
  > [mailto:[hidden email]] On Behalf Of Troy Robertson
  > Sent: Wednesday, October 06, 2010 6:13 PM
  > To: '[hidden email]'
  > Subject: Re: [Rd] Recursion error after upgrade to
  > R_2.11.1[Sec=Unclassified]
It was due to a miscount of how many frames to go
up before evaluating an expression in
getMethod("[[<-",".environment") because setMethod()
introduced a local function in the new method.

Bill Dunlap
Spotfire, TIBCO Software
wdunlap tibco.com  

> -----Original Message-----
> From: [hidden email]
> [mailto:[hidden email]] On Behalf Of Vitally S.
> Sent: Thursday, October 21, 2010 9:00 AM
> To: John Chambers
> Cc: [hidden email]
> Subject: Re: [Rd] new.env does not recognize parents from
> subclassesof "environment"
>
>
>
> Here is an infinite recursion error  which occurs only with S4
> subclasses assignment.
>
>  setClass("myenv", contains = "environment")
> #[1] "myenv"
>  env <- new("myenv")
>  env[[".me"]] <- env@.xData
> #Error: evaluation nested too deeply: infinite recursion /
> options(expressions=)?
>  
>
> With basic types it works as expected:
>
> env1 <- new.env()
> env1[[".me"]] <- env1
>
> May be this is related to active bindings that you mentioned,
>  but I am still
> reporting it here.
>
> Vitally.
>
>
> >  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.
> >>
> >> ______________________________________________
> >> [hidden email] mailing list
> >> https://stat.ethz.ch/mailman/listinfo/r-devel>
>
> ______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Reply | Threaded
Open this post in threaded view
|

Re: new.env does not recognize parents from subclassesof "environment"

John Chambers
  This is a problem related to the introduction of exact= into the [[
and [[<- functions. As Bill says, the current method misuses
eval.parent() when that argument is added.

However, a simpler and more efficient solution is to migrate the checks
for subclasses of "environment" used in other base code into the code
for [[<- (and for $<-), at which point the methods for these functions
are no longer needed.

A solution on these lines is being tested now and will find its way into
r-devel and 2.12 patched.

One other point about the original posting:

Please don't use constructions like env@.xData. This depends on the
current implementation and is not part of the user-level definition. Use
as(env, "environment") or equivalent. (In this case, the assignment of
the object's own environment was irrelevant to the error.)

John Chambers

On 10/21/10 9:21 AM, William Dunlap wrote:

> The traceback looks very similar to a problem
> in R 2.11.1 reported earlier this month by Troy Robertson.
>    >  From: [hidden email]
>    >  [mailto:[hidden email]] On Behalf Of Troy Robertson
>    >  Sent: Wednesday, October 06, 2010 6:13 PM
>    >  To: '[hidden email]'
>    >  Subject: Re: [Rd] Recursion error after upgrade to
>    >  R_2.11.1[Sec=Unclassified]
> It was due to a miscount of how many frames to go
> up before evaluating an expression in
> getMethod("[[<-",".environment") because setMethod()
> introduced a local function in the new method.
>
> Bill Dunlap
> Spotfire, TIBCO Software
> wdunlap tibco.com
>
>> -----Original Message-----
>> From: [hidden email]
>> [mailto:[hidden email]] On Behalf Of Vitally S.
>> Sent: Thursday, October 21, 2010 9:00 AM
>> To: John Chambers
>> Cc: [hidden email]
>> Subject: Re: [Rd] new.env does not recognize parents from
>> subclassesof "environment"
>>
>>
>>
>> Here is an infinite recursion error  which occurs only with S4
>> subclasses assignment.
>>
>>   setClass("myenv", contains = "environment")
>> #[1] "myenv"
>>   env<- new("myenv")
>>   env[[".me"]]<- ∑
>> #Error: evaluation nested too deeply: infinite recursion /
>> options(expressions=)?
>>
>>
>> With basic types it works as expected:
>>
>> env1<- new.env()
>> env1[[".me"]]<- env1
>>
>> May be this is related to active bindings that you mentioned,
>>   but I am still
>> reporting it here.
>>
>> Vitally.
>>
>>
>>>   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.
>>>>
>>>> ______________________________________________
>>>> [hidden email] mailing list
>>>> https://stat.ethz.ch/mailman/listinfo/r-devel>
>> ______________________________________________
>> [hidden email] mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-devel
>>

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Reply | Threaded
Open this post in threaded view
|

Re: new.env does not recognize parents from subclassesof "environment"

Vitalie S.-2

Yet another inconsistency. environment<- does not work with S4:


> setClass("myenv", contains = "environment")
[1] "myenv"
> env <- new("myenv")
> tf <- function(x){x}
> environment(tf) <- env
Error in environment(tf) <- env :
  replacement object is not an environment


Vitally.


John Chambers <[hidden email]> writes:

>  This is a problem related to the introduction of exact= into the [[ and [[<- functions. As Bill says, the current
> method misuses eval.parent() when that argument is added.
>
> However, a simpler and more efficient solution is to migrate the checks for subclasses of "environment" used in
> other base code into the code for [[<- (and for $<-), at which point the methods for these functions are no longer
> needed.
>
> A solution on these lines is being tested now and will find its way into r-devel and 2.12 patched.
>
> One other point about the original posting:
>
> Please don't use constructions like env@.xData. This depends on the current implementation and is not part of the
> user-level definition. Use as(env, "environment") or equivalent. (In this case, the assignment of the object's own
> environment was irrelevant to the error.)
>
> John Chambers
>
> On 10/21/10 9:21 AM, William Dunlap wrote:
>> The traceback looks very similar to a problem
>> in R 2.11.1 reported earlier this month by Troy Robertson.
>>    >  From: [hidden email]
>>    >  [mailto:[hidden email]] On Behalf Of Troy Robertson
>>    >  Sent: Wednesday, October 06, 2010 6:13 PM
>>    >  To: '[hidden email]'
>>    >  Subject: Re: [Rd] Recursion error after upgrade to
>>    >  R_2.11.1[Sec=Unclassified]
>> It was due to a miscount of how many frames to go
>> up before evaluating an expression in
>> getMethod("[[<-",".environment") because setMethod()
>> introduced a local function in the new method.
>>
>> Bill Dunlap
>> Spotfire, TIBCO Software
>> wdunlap tibco.com
>>
>>> -----Original Message-----
>>> From: [hidden email]
>>> [mailto:[hidden email]] On Behalf Of Vitally S.
>>> Sent: Thursday, October 21, 2010 9:00 AM
>>> To: John Chambers
>>> Cc: [hidden email]
>>> Subject: Re: [Rd] new.env does not recognize parents from
>>> subclassesof "environment"
>>>
>>>
>>>
>>> Here is an infinite recursion error  which occurs only with S4
>>> subclasses assignment.
>>>
>>>   setClass("myenv", contains = "environment")
>>> #[1] "myenv"
>>>   env<- new("myenv")
>>>   env[[".me"]]<- ∑
>>> #Error: evaluation nested too deeply: infinite recursion /
>>> options(expressions=)?
>>>
>>>
>>> With basic types it works as expected:
>>>
>>> env1<- new.env()
>>> env1[[".me"]]<- env1
>>>
>>> May be this is related to active bindings that you mentioned,
>>>   but I am still
>>> reporting it here.
>>>
>>> Vitally.
>>>
>>>
>>>>   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.
>>>>>
>>>>> ______________________________________________
>>>>> [hidden email] mailing list
>>>>> https://stat.ethz.ch/mailman/listinfo/r-devel>>> ______________________________________________
>>> [hidden email] mailing list
>>> https://stat.ethz.ch/mailman/listinfo/r-devel>>
>
> ______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Reply | Threaded
Open this post in threaded view
|

Re: new.env does not recognize parents from subclassesof "environment"

John Chambers
 You need to update your version of R (r-devel or 2.12 patched) to rev
53385 or later, and read NEWS, particularly the line:


- Assignment of an environment to functions or as an attribute to other
objects now works for subclasses of "environment".



On 10/22/10 10:20 AM, Vitally S. wrote:

> Yet another inconsistency. environment<- does not work with S4:
>
>
>> setClass("myenv", contains = "environment")
> [1] "myenv"
>> env <- new("myenv")
>> tf <- function(x){x}
>> environment(tf) <- env
> Error in environment(tf) <- env :
>   replacement object is not an environment
>
>
> Vitally.
>
>
> John Chambers <[hidden email]> writes:
>>  This is a problem related to the introduction of exact= into the [[ and [[<- functions. As Bill says, the current
>> method misuses eval.parent() when that argument is added.
>>
>> However, a simpler and more efficient solution is to migrate the checks for subclasses of "environment" used in
>> other base code into the code for [[<- (and for $<-), at which point the methods for these functions are no longer
>> needed.
>>
>> A solution on these lines is being tested now and will find its way into r-devel and 2.12 patched.
>>
>> One other point about the original posting:
>>
>> Please don't use constructions like env@.xData. This depends on the current implementation and is not part of the
>> user-level definition. Use as(env, "environment") or equivalent. (In this case, the assignment of the object's own
>> environment was irrelevant to the error.)
>>
>> John Chambers
>>
>> On 10/21/10 9:21 AM, William Dunlap wrote:
>>> The traceback looks very similar to a problem
>>> in R 2.11.1 reported earlier this month by Troy Robertson.
>>>    >  From: [hidden email]
>>>    >  [mailto:[hidden email]] On Behalf Of Troy Robertson
>>>    >  Sent: Wednesday, October 06, 2010 6:13 PM
>>>    >  To: '[hidden email]'
>>>    >  Subject: Re: [Rd] Recursion error after upgrade to
>>>    >  R_2.11.1[Sec=Unclassified]
>>> It was due to a miscount of how many frames to go
>>> up before evaluating an expression in
>>> getMethod("[[<-",".environment") because setMethod()
>>> introduced a local function in the new method.
>>>
>>> Bill Dunlap
>>> Spotfire, TIBCO Software
>>> wdunlap tibco.com
>>>
>>>> -----Original Message-----
>>>> From: [hidden email]
>>>> [mailto:[hidden email]] On Behalf Of Vitally S.
>>>> Sent: Thursday, October 21, 2010 9:00 AM
>>>> To: John Chambers
>>>> Cc: [hidden email]
>>>> Subject: Re: [Rd] new.env does not recognize parents from
>>>> subclassesof "environment"
>>>>
>>>>
>>>>
>>>> Here is an infinite recursion error  which occurs only with S4
>>>> subclasses assignment.
>>>>
>>>>   setClass("myenv", contains = "environment")
>>>> #[1] "myenv"
>>>>   env<- new("myenv")
>>>>   env[[".me"]]<- ∑
>>>> #Error: evaluation nested too deeply: infinite recursion /
>>>> options(expressions=)?
>>>>
>>>>
>>>> With basic types it works as expected:
>>>>
>>>> env1<- new.env()
>>>> env1[[".me"]]<- env1
>>>>
>>>> May be this is related to active bindings that you mentioned,
>>>>   but I am still
>>>> reporting it here.
>>>>
>>>> Vitally.
>>>>
>>>>
>>>>>   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.
>>>>>>
>>>>>> ______________________________________________
>>>>>> [hidden email] mailing list
>>>>>> https://stat.ethz.ch/mailman/listinfo/r-devel>>> ______________________________________________
>>>> [hidden email] mailing list
>>>> https://stat.ethz.ch/mailman/listinfo/r-devel>>
>> ______________________________________________
>> [hidden email] mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-devel
> ______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Reply | Threaded
Open this post in threaded view
|

Re: new.env does not recognize parents from subclassesof "environment"

Vitalie S.-2



John Chambers <[hidden email]> writes:

>  You need to update your version of R (r-devel or 2.12 patched) to rev
> 53385 or later, and read NEWS, particularly the line:
>
> - Assignment of an environment to functions or as an attribute to other
> objects now works for subclasses of "environment".
>

I am following the news in daily snapshots from here
ftp://ftp.stat.math.ethz.ch/Software/R
and  the above line is still not in the NEWS of today's version.

Thanks for the patch. Looking forward to the stable release.

Vitally.

> On 10/22/10 10:20 AM, Vitally S. wrote:
>> Yet another inconsistency. environment<- does not work with S4:
>>
>>
>>> setClass("myenv", contains = "environment")
>> [1] "myenv"
>>> env <- new("myenv")
>>> tf <- function(x){x}
>>> environment(tf) <- env
>> Error in environment(tf) <- env :
>>   replacement object is not an environment
>>
>>
>> Vitally.
>>
>>
>> John Chambers <[hidden email]> writes:
>>> This is a problem related to the introduction of exact= into the [[ and [[<- functions. As Bill says, the
> current
>>> method misuses eval.parent() when that argument is added.
>>>
>>> However, a simpler and more efficient solution is to migrate the checks for subclasses of "environment" used in
>>> other base code into the code for [[<- (and for $<-), at which point the methods for these functions are no
> longer
>>> needed.
>>>
>>> A solution on these lines is being tested now and will find its way into r-devel and 2.12 patched.
>>>
>>> One other point about the original posting:
>>>
>>> Please don't use constructions like env@.xData. This depends on the current implementation and is not part of
> the
>>> user-level definition. Use as(env, "environment") or equivalent. (In this case, the assignment of the object's
> own
>>> environment was irrelevant to the error.)
>>>
>>> John Chambers
>>>
>>> On 10/21/10 9:21 AM, William Dunlap wrote:
>>>> The traceback looks very similar to a problem
>>>> in R 2.11.1 reported earlier this month by Troy Robertson.
>>>>    >  From: [hidden email]
>>>>    >  [mailto:[hidden email]] On Behalf Of Troy Robertson
>>>>    >  Sent: Wednesday, October 06, 2010 6:13 PM
>>>>    >  To: '[hidden email]'
>>>>    >  Subject: Re: [Rd] Recursion error after upgrade to
>>>>    >  R_2.11.1[Sec=Unclassified]
>>>> It was due to a miscount of how many frames to go
>>>> up before evaluating an expression in
>>>> getMethod("[[<-",".environment") because setMethod()
>>>> introduced a local function in the new method.
>>>>
>>>> Bill Dunlap
>>>> Spotfire, TIBCO Software
>>>> wdunlap tibco.com
>>>>
>>>>> -----Original Message-----
>>>>> From: [hidden email]
>>>>> [mailto:[hidden email]] On Behalf Of Vitally S.
>>>>> Sent: Thursday, October 21, 2010 9:00 AM
>>>>> To: John Chambers
>>>>> Cc: [hidden email]
>>>>> Subject: Re: [Rd] new.env does not recognize parents from
>>>>> subclassesof "environment"
>>>>>
>>>>>
>>>>>
>>>>> Here is an infinite recursion error  which occurs only with S4
>>>>> subclasses assignment.
>>>>>
>>>>>   setClass("myenv", contains = "environment")
>>>>> #[1] "myenv"
>>>>>   env<- new("myenv")
>>>>>   env[[".me"]]<- ∑
>>>>> #Error: evaluation nested too deeply: infinite recursion /
>>>>> options(expressions=)?
>>>>>
>>>>>
>>>>> With basic types it works as expected:
>>>>>
>>>>> env1<- new.env()
>>>>> env1[[".me"]]<- env1
>>>>>
>>>>> May be this is related to active bindings that you mentioned,
>>>>>   but I am still
>>>>> reporting it here.
>>>>>
>>>>> Vitally.
>>>>>
>>>>>
>>>>>>   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.
>>>>>>>
>>>>>>> ______________________________________________
>>>>>>> [hidden email] mailing list
>>>>>>> https://stat.ethz.ch/mailman/listinfo/r-devel>>> ______________________________________________
>>>>> [hidden email] mailing list
>>>>> https://stat.ethz.ch/mailman/listinfo/r-devel>>>> ______________________________________________
>>> [hidden email] mailing list
>>> https://stat.ethz.ch/mailman/listinfo/r-devel> ______________________________________________
>> [hidden email] mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-devel
>
> ______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Reply | Threaded
Open this post in threaded view
|

Re: new.env does not recognize parents from subclassesof "environment"

Uwe Ligges-3
Looks like those ETH pages were nnot updated after the R-2.12.0 release
(they do not show current R-tached / R-devel), hence CCing Martin Maechler.

Best,
Uwe Ligges





On 22.10.2010 21:54, Vitally S. wrote:

>
>
>
> John Chambers<[hidden email]>  writes:
>
>>   You need to update your version of R (r-devel or 2.12 patched) to rev
>> 53385 or later, and read NEWS, particularly the line:
>>
>> - Assignment of an environment to functions or as an attribute to other
>> objects now works for subclasses of "environment".
>>
>
> I am following the news in daily snapshots from here
> ftp://ftp.stat.math.ethz.ch/Software/R
> and  the above line is still not in the NEWS of today's version.
>
> Thanks for the patch. Looking forward to the stable release.
>
> Vitally.
>
>> On 10/22/10 10:20 AM, Vitally S. wrote:
>>> Yet another inconsistency. environment<- does not work with S4:
>>>
>>>
>>>> setClass("myenv", contains = "environment")
>>> [1] "myenv"
>>>> env<- new("myenv")
>>>> tf<- function(x){x}
>>>> environment(tf)<- env
>>> Error in environment(tf)<- env :
>>>    replacement object is not an environment
>>>
>>>
>>> Vitally.
>>>
>>>
>>> John Chambers<[hidden email]>  writes:
>>>> This is a problem related to the introduction of exact= into the [[ and [[<- functions. As Bill says, the
>> current
>>>> method misuses eval.parent() when that argument is added.
>>>>
>>>> However, a simpler and more efficient solution is to migrate the checks for subclasses of "environment" used in
>>>> other base code into the code for [[<- (and for $<-), at which point the methods for these functions are no
>> longer
>>>> needed.
>>>>
>>>> A solution on these lines is being tested now and will find its way into r-devel and 2.12 patched.
>>>>
>>>> One other point about the original posting:
>>>>
>>>> Please don't use constructions like env@.xData. This depends on the current implementation and is not part of
>> the
>>>> user-level definition. Use as(env, "environment") or equivalent. (In this case, the assignment of the object's
>> own
>>>> environment was irrelevant to the error.)
>>>>
>>>> John Chambers
>>>>
>>>> On 10/21/10 9:21 AM, William Dunlap wrote:
>>>>> The traceback looks very similar to a problem
>>>>> in R 2.11.1 reported earlier this month by Troy Robertson.
>>>>>     >   From: [hidden email]
>>>>>     >   [mailto:[hidden email]] On Behalf Of Troy Robertson
>>>>>     >   Sent: Wednesday, October 06, 2010 6:13 PM
>>>>>     >   To: '[hidden email]'
>>>>>     >   Subject: Re: [Rd] Recursion error after upgrade to
>>>>>     >   R_2.11.1[Sec=Unclassified]
>>>>> It was due to a miscount of how many frames to go
>>>>> up before evaluating an expression in
>>>>> getMethod("[[<-",".environment") because setMethod()
>>>>> introduced a local function in the new method.
>>>>>
>>>>> Bill Dunlap
>>>>> Spotfire, TIBCO Software
>>>>> wdunlap tibco.com
>>>>>
>>>>>> -----Original Message-----
>>>>>> From: [hidden email]
>>>>>> [mailto:[hidden email]] On Behalf Of Vitally S.
>>>>>> Sent: Thursday, October 21, 2010 9:00 AM
>>>>>> To: John Chambers
>>>>>> Cc: [hidden email]
>>>>>> Subject: Re: [Rd] new.env does not recognize parents from
>>>>>> subclassesof "environment"
>>>>>>
>>>>>>
>>>>>>
>>>>>> Here is an infinite recursion error  which occurs only with S4
>>>>>> subclasses assignment.
>>>>>>
>>>>>>    setClass("myenv", contains = "environment")
>>>>>> #[1] "myenv"
>>>>>>    env<- new("myenv")
>>>>>>    env[[".me"]]<- ∑
>>>>>> #Error: evaluation nested too deeply: infinite recursion /
>>>>>> options(expressions=)?
>>>>>>
>>>>>>
>>>>>> With basic types it works as expected:
>>>>>>
>>>>>> env1<- new.env()
>>>>>> env1[[".me"]]<- env1
>>>>>>
>>>>>> May be this is related to active bindings that you mentioned,
>>>>>>    but I am still
>>>>>> reporting it here.
>>>>>>
>>>>>> Vitally.
>>>>>>
>>>>>>
>>>>>>>    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.
>>>>>>>>
>>>>>>>> ______________________________________________
>>>>>>>> [hidden email] mailing list
>>>>>>>> https://stat.ethz.ch/mailman/listinfo/r-devel>>>  ______________________________________________
>>>>>> [hidden email] mailing list
>>>>>> https://stat.ethz.ch/mailman/listinfo/r-devel>>>>  ______________________________________________
>>>> [hidden email] mailing list
>>>> https://stat.ethz.ch/mailman/listinfo/r-devel>  ______________________________________________
>>> [hidden email] mailing list
>>> https://stat.ethz.ch/mailman/listinfo/r-devel
>>
>> ______________________________________________
>> [hidden email] mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-devel
>
> ______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Reply | Threaded
Open this post in threaded view
|

Re: new.env does not recognize parents from subclassesof "environment"

Uwe Ligges-3


On 23.10.2010 17:08, Uwe Ligges wrote:
> Looks like those ETH pages were nnot updated after the R-2.12.0 release
> (they do not show current R-tached / R-devel), hence CCing Martin Maechler.


... which I actually do now...

Uwe


> Best,
> Uwe Ligges
>
>
>
>
>
> On 22.10.2010 21:54, Vitally S. wrote:
>>
>>
>>
>> John Chambers<[hidden email]> writes:
>>
>>> You need to update your version of R (r-devel or 2.12 patched) to rev
>>> 53385 or later, and read NEWS, particularly the line:
>>>
>>> - Assignment of an environment to functions or as an attribute to other
>>> objects now works for subclasses of "environment".
>>>
>>
>> I am following the news in daily snapshots from here
>> ftp://ftp.stat.math.ethz.ch/Software/R
>> and the above line is still not in the NEWS of today's version.
>>
>> Thanks for the patch. Looking forward to the stable release.
>>
>> Vitally.
>>
>>> On 10/22/10 10:20 AM, Vitally S. wrote:
>>>> Yet another inconsistency. environment<- does not work with S4:
>>>>
>>>>
>>>>> setClass("myenv", contains = "environment")
>>>> [1] "myenv"
>>>>> env<- new("myenv")
>>>>> tf<- function(x){x}
>>>>> environment(tf)<- env
>>>> Error in environment(tf)<- env :
>>>> replacement object is not an environment
>>>>
>>>>
>>>> Vitally.
>>>>
>>>>
>>>> John Chambers<[hidden email]> writes:
>>>>> This is a problem related to the introduction of exact= into the [[
>>>>> and [[<- functions. As Bill says, the
>>> current
>>>>> method misuses eval.parent() when that argument is added.
>>>>>
>>>>> However, a simpler and more efficient solution is to migrate the
>>>>> checks for subclasses of "environment" used in
>>>>> other base code into the code for [[<- (and for $<-), at which
>>>>> point the methods for these functions are no
>>> longer
>>>>> needed.
>>>>>
>>>>> A solution on these lines is being tested now and will find its way
>>>>> into r-devel and 2.12 patched.
>>>>>
>>>>> One other point about the original posting:
>>>>>
>>>>> Please don't use constructions like env@.xData. This depends on the
>>>>> current implementation and is not part of
>>> the
>>>>> user-level definition. Use as(env, "environment") or equivalent.
>>>>> (In this case, the assignment of the object's
>>> own
>>>>> environment was irrelevant to the error.)
>>>>>
>>>>> John Chambers
>>>>>
>>>>> On 10/21/10 9:21 AM, William Dunlap wrote:
>>>>>> The traceback looks very similar to a problem
>>>>>> in R 2.11.1 reported earlier this month by Troy Robertson.
>>>>>> > From: [hidden email]
>>>>>> > [mailto:[hidden email]] On Behalf Of Troy Robertson
>>>>>> > Sent: Wednesday, October 06, 2010 6:13 PM
>>>>>> > To: '[hidden email]'
>>>>>> > Subject: Re: [Rd] Recursion error after upgrade to
>>>>>> > R_2.11.1[Sec=Unclassified]
>>>>>> It was due to a miscount of how many frames to go
>>>>>> up before evaluating an expression in
>>>>>> getMethod("[[<-",".environment") because setMethod()
>>>>>> introduced a local function in the new method.
>>>>>>
>>>>>> Bill Dunlap
>>>>>> Spotfire, TIBCO Software
>>>>>> wdunlap tibco.com
>>>>>>
>>>>>>> -----Original Message-----
>>>>>>> From: [hidden email]
>>>>>>> [mailto:[hidden email]] On Behalf Of Vitally S.
>>>>>>> Sent: Thursday, October 21, 2010 9:00 AM
>>>>>>> To: John Chambers
>>>>>>> Cc: [hidden email]
>>>>>>> Subject: Re: [Rd] new.env does not recognize parents from
>>>>>>> subclassesof "environment"
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> Here is an infinite recursion error which occurs only with S4
>>>>>>> subclasses assignment.
>>>>>>>
>>>>>>> setClass("myenv", contains = "environment")
>>>>>>> #[1] "myenv"
>>>>>>> env<- new("myenv")
>>>>>>> env[[".me"]]<- ∑
>>>>>>> #Error: evaluation nested too deeply: infinite recursion /
>>>>>>> options(expressions=)?
>>>>>>>
>>>>>>>
>>>>>>> With basic types it works as expected:
>>>>>>>
>>>>>>> env1<- new.env()
>>>>>>> env1[[".me"]]<- env1
>>>>>>>
>>>>>>> May be this is related to active bindings that you mentioned,
>>>>>>> but I am still
>>>>>>> reporting it here.
>>>>>>>
>>>>>>> Vitally.
>>>>>>>
>>>>>>>
>>>>>>>> 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.
>>>>>>>>>
>>>>>>>>> ______________________________________________
>>>>>>>>> [hidden email] mailing list
>>>>>>>>> https://stat.ethz.ch/mailman/listinfo/r-devel>>>
>>>>>>>>> ______________________________________________
>>>>>>> [hidden email] mailing list
>>>>>>> https://stat.ethz.ch/mailman/listinfo/r-devel>>>>
>>>>>>> ______________________________________________
>>>>> [hidden email] mailing list
>>>>> https://stat.ethz.ch/mailman/listinfo/r-devel>
>>>>> ______________________________________________
>>>> [hidden email] mailing list
>>>> https://stat.ethz.ch/mailman/listinfo/r-devel
>>>
>>> ______________________________________________
>>> [hidden email] mailing list
>>> https://stat.ethz.ch/mailman/listinfo/r-devel
>>
>> ______________________________________________
>> [hidden email] mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-devel

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Reply | Threaded
Open this post in threaded view
|

Re: new.env does not recognize parents from subclassesof "environment"

Martin Maechler
2010/10/23 Uwe Ligges <[hidden email]>:

>
>
> On 23.10.2010 17:08, Uwe Ligges wrote:
>>
>> Looks like those ETH pages were nnot updated after the R-2.12.0 release
>> (they do not show current R-tached / R-devel), hence CCing Martin
>> Maechler.
>
>
> ... which I actually do now...

Hmm, but why?
The daily snapshot page *does* show the current R-patched and R-devel
tar balls ?

Or what were you talking about ?

Regards,
Martin

>
> Uwe
>
>
>> Best,
>> Uwe Ligges
>>
>>
>>
>>
>>
>> On 22.10.2010 21:54, Vitally S. wrote:
>>>
>>>
>>>
>>> John Chambers<[hidden email]> writes:
>>>
>>>> You need to update your version of R (r-devel or 2.12 patched) to rev
>>>> 53385 or later, and read NEWS, particularly the line:
>>>>
>>>> - Assignment of an environment to functions or as an attribute to other
>>>> objects now works for subclasses of "environment".
>>>>
>>>
>>> I am following the news in daily snapshots from here
>>> ftp://ftp.stat.math.ethz.ch/Software/R
>>> and the above line is still not in the NEWS of today's version.
>>>
>>> Thanks for the patch. Looking forward to the stable release.
>>>
>>> Vitally.
>>>
>>>> On 10/22/10 10:20 AM, Vitally S. wrote:
>>>>>
>>>>> Yet another inconsistency. environment<- does not work with S4:
>>>>>
>>>>>
>>>>>> setClass("myenv", contains = "environment")
>>>>>
>>>>> [1] "myenv"
>>>>>>
>>>>>> env<- new("myenv")
>>>>>> tf<- function(x){x}
>>>>>> environment(tf)<- env
>>>>>
>>>>> Error in environment(tf)<- env :
>>>>> replacement object is not an environment
>>>>>
>>>>>
>>>>> Vitally.
>>>>>
>>>>>
>>>>> John Chambers<[hidden email]> writes:
>>>>>>
>>>>>> This is a problem related to the introduction of exact= into the [[
>>>>>> and [[<- functions. As Bill says, the
>>>>
>>>> current
>>>>>>
>>>>>> method misuses eval.parent() when that argument is added.
>>>>>>
>>>>>> However, a simpler and more efficient solution is to migrate the
>>>>>> checks for subclasses of "environment" used in
>>>>>> other base code into the code for [[<- (and for $<-), at which
>>>>>> point the methods for these functions are no
>>>>
>>>> longer
>>>>>>
>>>>>> needed.
>>>>>>
>>>>>> A solution on these lines is being tested now and will find its way
>>>>>> into r-devel and 2.12 patched.
>>>>>>
>>>>>> One other point about the original posting:
>>>>>>
>>>>>> Please don't use constructions like env@.xData. This depends on the
>>>>>> current implementation and is not part of
>>>>
>>>> the
>>>>>>
>>>>>> user-level definition. Use as(env, "environment") or equivalent.
>>>>>> (In this case, the assignment of the object's
>>>>
>>>> own
>>>>>>
>>>>>> environment was irrelevant to the error.)
>>>>>>
>>>>>> John Chambers
>>>>>>
>>>>>> On 10/21/10 9:21 AM, William Dunlap wrote:
>>>>>>>
>>>>>>> The traceback looks very similar to a problem
>>>>>>> in R 2.11.1 reported earlier this month by Troy Robertson.
>>>>>>> > From: [hidden email]
>>>>>>> > [mailto:[hidden email]] On Behalf Of Troy Robertson
>>>>>>> > Sent: Wednesday, October 06, 2010 6:13 PM
>>>>>>> > To: '[hidden email]'
>>>>>>> > Subject: Re: [Rd] Recursion error after upgrade to
>>>>>>> > R_2.11.1[Sec=Unclassified]
>>>>>>> It was due to a miscount of how many frames to go
>>>>>>> up before evaluating an expression in
>>>>>>> getMethod("[[<-",".environment") because setMethod()
>>>>>>> introduced a local function in the new method.
>>>>>>>
>>>>>>> Bill Dunlap
>>>>>>> Spotfire, TIBCO Software
>>>>>>> wdunlap tibco.com
>>>>>>>
>>>>>>>> -----Original Message-----
>>>>>>>> From: [hidden email]
>>>>>>>> [mailto:[hidden email]] On Behalf Of Vitally S.
>>>>>>>> Sent: Thursday, October 21, 2010 9:00 AM
>>>>>>>> To: John Chambers
>>>>>>>> Cc: [hidden email]
>>>>>>>> Subject: Re: [Rd] new.env does not recognize parents from
>>>>>>>> subclassesof "environment"
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> Here is an infinite recursion error which occurs only with S4
>>>>>>>> subclasses assignment.
>>>>>>>>
>>>>>>>> setClass("myenv", contains = "environment")
>>>>>>>> #[1] "myenv"
>>>>>>>> env<- new("myenv")
>>>>>>>> env[[".me"]]<- ∑
>>>>>>>> #Error: evaluation nested too deeply: infinite recursion /
>>>>>>>> options(expressions=)?
>>>>>>>>
>>>>>>>>
>>>>>>>> With basic types it works as expected:
>>>>>>>>
>>>>>>>> env1<- new.env()
>>>>>>>> env1[[".me"]]<- env1
>>>>>>>>
>>>>>>>> May be this is related to active bindings that you mentioned,
>>>>>>>> but I am still
>>>>>>>> reporting it here.
>>>>>>>>
>>>>>>>> Vitally.
>>>>>>>>
>>>>>>>>
>>>>>>>>> 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.
>>>>>>>>>>
>>>>>>>>>> ______________________________________________
>>>>>>>>>> [hidden email] mailing list
>>>>>>>>>> https://stat.ethz.ch/mailman/listinfo/r-devel>>>
>>>>>>>>>> ______________________________________________
>>>>>>>>
>>>>>>>> [hidden email] mailing list
>>>>>>>> https://stat.ethz.ch/mailman/listinfo/r-devel>>>>
>>>>>>>> ______________________________________________
>>>>>>
>>>>>> [hidden email] mailing list
>>>>>> https://stat.ethz.ch/mailman/listinfo/r-devel>
>>>>>> ______________________________________________
>>>>>
>>>>> [hidden email] mailing list
>>>>> https://stat.ethz.ch/mailman/listinfo/r-devel
>>>>
>>>> ______________________________________________
>>>> [hidden email] mailing list
>>>> https://stat.ethz.ch/mailman/listinfo/r-devel
>>>
>>> ______________________________________________
>>> [hidden email] mailing list
>>> https://stat.ethz.ch/mailman/listinfo/r-devel
>
>

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Reply | Threaded
Open this post in threaded view
|

Re: new.env does not recognize parents from subclassesof "environment"

Uwe Ligges-3


On 23.10.2010 17:25, Martin Maechler wrote:

> 2010/10/23 Uwe Ligges<[hidden email]>:
>>
>>
>> On 23.10.2010 17:08, Uwe Ligges wrote:
>>>
>>> Looks like those ETH pages were nnot updated after the R-2.12.0 release
>>> (they do not show current R-tached / R-devel), hence CCing Martin
>>> Maechler.
>>
>>
>> ... which I actually do now...
>
> Hmm, but why?
> The daily snapshot page *does* show the current R-patched and R-devel
> tar balls ?
>
> Or what were you talking about ?

We are talking about the

http://stat.ethz.ch/R-manual/

page. R-devel NEWS show R-2.12.0, just as on example.

Uwe




> Regards,
> Martin
>
>>
>> Uwe
>>
>>
>>> Best,
>>> Uwe Ligges
>>>
>>>
>>>
>>>
>>>
>>> On 22.10.2010 21:54, Vitally S. wrote:
>>>>
>>>>
>>>>
>>>> John Chambers<[hidden email]>  writes:
>>>>
>>>>> You need to update your version of R (r-devel or 2.12 patched) to rev
>>>>> 53385 or later, and read NEWS, particularly the line:
>>>>>
>>>>> - Assignment of an environment to functions or as an attribute to other
>>>>> objects now works for subclasses of "environment".
>>>>>
>>>>
>>>> I am following the news in daily snapshots from here
>>>> ftp://ftp.stat.math.ethz.ch/Software/R
>>>> and the above line is still not in the NEWS of today's version.
>>>>
>>>> Thanks for the patch. Looking forward to the stable release.
>>>>
>>>> Vitally.
>>>>
>>>>> On 10/22/10 10:20 AM, Vitally S. wrote:
>>>>>>
>>>>>> Yet another inconsistency. environment<- does not work with S4:
>>>>>>
>>>>>>
>>>>>>> setClass("myenv", contains = "environment")
>>>>>>
>>>>>> [1] "myenv"
>>>>>>>
>>>>>>> env<- new("myenv")
>>>>>>> tf<- function(x){x}
>>>>>>> environment(tf)<- env
>>>>>>
>>>>>> Error in environment(tf)<- env :
>>>>>> replacement object is not an environment
>>>>>>
>>>>>>
>>>>>> Vitally.
>>>>>>
>>>>>>
>>>>>> John Chambers<[hidden email]>  writes:
>>>>>>>
>>>>>>> This is a problem related to the introduction of exact= into the [[
>>>>>>> and [[<- functions. As Bill says, the
>>>>>
>>>>> current
>>>>>>>
>>>>>>> method misuses eval.parent() when that argument is added.
>>>>>>>
>>>>>>> However, a simpler and more efficient solution is to migrate the
>>>>>>> checks for subclasses of "environment" used in
>>>>>>> other base code into the code for [[<- (and for $<-), at which
>>>>>>> point the methods for these functions are no
>>>>>
>>>>> longer
>>>>>>>
>>>>>>> needed.
>>>>>>>
>>>>>>> A solution on these lines is being tested now and will find its way
>>>>>>> into r-devel and 2.12 patched.
>>>>>>>
>>>>>>> One other point about the original posting:
>>>>>>>
>>>>>>> Please don't use constructions like env@.xData. This depends on the
>>>>>>> current implementation and is not part of
>>>>>
>>>>> the
>>>>>>>
>>>>>>> user-level definition. Use as(env, "environment") or equivalent.
>>>>>>> (In this case, the assignment of the object's
>>>>>
>>>>> own
>>>>>>>
>>>>>>> environment was irrelevant to the error.)
>>>>>>>
>>>>>>> John Chambers
>>>>>>>
>>>>>>> On 10/21/10 9:21 AM, William Dunlap wrote:
>>>>>>>>
>>>>>>>> The traceback looks very similar to a problem
>>>>>>>> in R 2.11.1 reported earlier this month by Troy Robertson.
>>>>>>>>> From: [hidden email]
>>>>>>>>> [mailto:[hidden email]] On Behalf Of Troy Robertson
>>>>>>>>> Sent: Wednesday, October 06, 2010 6:13 PM
>>>>>>>>> To: '[hidden email]'
>>>>>>>>> Subject: Re: [Rd] Recursion error after upgrade to
>>>>>>>>> R_2.11.1[Sec=Unclassified]
>>>>>>>> It was due to a miscount of how many frames to go
>>>>>>>> up before evaluating an expression in
>>>>>>>> getMethod("[[<-",".environment") because setMethod()
>>>>>>>> introduced a local function in the new method.
>>>>>>>>
>>>>>>>> Bill Dunlap
>>>>>>>> Spotfire, TIBCO Software
>>>>>>>> wdunlap tibco.com
>>>>>>>>
>>>>>>>>> -----Original Message-----
>>>>>>>>> From: [hidden email]
>>>>>>>>> [mailto:[hidden email]] On Behalf Of Vitally S.
>>>>>>>>> Sent: Thursday, October 21, 2010 9:00 AM
>>>>>>>>> To: John Chambers
>>>>>>>>> Cc: [hidden email]
>>>>>>>>> Subject: Re: [Rd] new.env does not recognize parents from
>>>>>>>>> subclassesof "environment"
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> Here is an infinite recursion error which occurs only with S4
>>>>>>>>> subclasses assignment.
>>>>>>>>>
>>>>>>>>> setClass("myenv", contains = "environment")
>>>>>>>>> #[1] "myenv"
>>>>>>>>> env<- new("myenv")
>>>>>>>>> env[[".me"]]<- ∑
>>>>>>>>> #Error: evaluation nested too deeply: infinite recursion /
>>>>>>>>> options(expressions=)?
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> With basic types it works as expected:
>>>>>>>>>
>>>>>>>>> env1<- new.env()
>>>>>>>>> env1[[".me"]]<- env1
>>>>>>>>>
>>>>>>>>> May be this is related to active bindings that you mentioned,
>>>>>>>>> but I am still
>>>>>>>>> reporting it here.
>>>>>>>>>
>>>>>>>>> Vitally.
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>> 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.
>>>>>>>>>>>
>>>>>>>>>>> ______________________________________________
>>>>>>>>>>> [hidden email] mailing list
>>>>>>>>>>> https://stat.ethz.ch/mailman/listinfo/r-devel>>>
>>>>>>>>>>> ______________________________________________
>>>>>>>>>
>>>>>>>>> [hidden email] mailing list
>>>>>>>>> https://stat.ethz.ch/mailman/listinfo/r-devel>>>>
>>>>>>>>> ______________________________________________
>>>>>>>
>>>>>>> [hidden email] mailing list
>>>>>>> https://stat.ethz.ch/mailman/listinfo/r-devel>
>>>>>>> ______________________________________________
>>>>>>
>>>>>> [hidden email] mailing list
>>>>>> https://stat.ethz.ch/mailman/listinfo/r-devel
>>>>>
>>>>> ______________________________________________
>>>>> [hidden email] mailing list
>>>>> https://stat.ethz.ch/mailman/listinfo/r-devel
>>>>
>>>> ______________________________________________
>>>> [hidden email] mailing list
>>>> https://stat.ethz.ch/mailman/listinfo/r-devel
>>
>>

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Reply | Threaded
Open this post in threaded view
|

Re: new.env does not recognize parents from subclassesof "environment"

Peter Dalgaard-2
On 10/23/2010 05:27 PM, Uwe Ligges wrote:

>
>
> On 23.10.2010 17:25, Martin Maechler wrote:
>> 2010/10/23 Uwe Ligges<[hidden email]>:
>>>
>>>
>>> On 23.10.2010 17:08, Uwe Ligges wrote:
>>>>
>>>> Looks like those ETH pages were nnot updated after the R-2.12.0 release
>>>> (they do not show current R-tached / R-devel), hence CCing Martin
>>>> Maechler.
>>>
>>>
>>> ... which I actually do now...
>>
>> Hmm, but why?
>> The daily snapshot page *does* show the current R-patched and R-devel
>> tar balls ?
>>
>> Or what were you talking about ?
>
> We are talking about the
>
> http://stat.ethz.ch/R-manual/
>
> page. R-devel NEWS show R-2.12.0, just as on example.
>
> Uwe
>

You need to get NEWS from $BUILDDIR these days. Anything left in $SRCDIR
is probably a relic.

--
Peter Dalgaard
Center for Statistics, Copenhagen Business School
Phone: (+45)38153501
Email: [hidden email]  Priv: [hidden email]

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Reply | Threaded
Open this post in threaded view
|

Re: new.env does not recognize parents from subclassesof "environment"

Martin Maechler
On Sat, Oct 23, 2010 at 18:23, Peter Dalgaard <[hidden email]> wrote:

> On 10/23/2010 05:27 PM, Uwe Ligges wrote:
>>
>>
>> On 23.10.2010 17:25, Martin Maechler wrote:
>>> 2010/10/23 Uwe Ligges<[hidden email]>:
>>>>
>>>>
>>>> On 23.10.2010 17:08, Uwe Ligges wrote:
>>>>>
>>>>> Looks like those ETH pages were nnot updated after the R-2.12.0 release
>>>>> (they do not show current R-tached / R-devel), hence CCing Martin
>>>>> Maechler.
>>>>
>>>>
>>>> ... which I actually do now...
>>>
>>> Hmm, but why?
>>> The daily snapshot page *does* show the current R-patched and R-devel
>>> tar balls ?
>>>
>>> Or what were you talking about ?
>>
>> We are talking about the
>>
>> http://stat.ethz.ch/R-manual/
>>

Thank you Uwe.   The other e-mail cited John mentioning the ./Software/ page.
Indeed those are outdated.

and for about 6 weeks.
The reason has been  ssh host keys changed, disabling a cron job to
run the updates...

I hope this will be ok, within a couple of hours.

>> page. R-devel NEWS show R-2.12.0, just as on example.
>>
>> Uwe
>
> You need to get NEWS from $BUILDDIR these days. Anything left in $SRCDIR
> is probably a relic.

Yes, of course, but that has not been the problem here.

Thank you Peter (and Uwe)
Martin
>
> --
> Peter Dalgaard
> Center for Statistics, Copenhagen Business School
> Phone: (+45)38153501
> Email: [hidden email]  Priv: [hidden email]
>
>

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel