Re: [Rd] parent.frame(1) of a S4 method is not a calling environment.

2010-08-18 Thread Vitaly S.
Hadley Wickham writes: > On Tuesday, August 17, 2010, Vitaly S. wrote: >> Duncan Murdoch writes: >> >>> Vitaly S. wrote: Martin Morgan writes: >> So,  can I be sure that for such functions parent.frame(2) will always >> work? >> What are the additional rules? >>

Re: [Rd] parent.frame(1) of a S4 method is not a calling environment.

2010-08-17 Thread Hadley Wickham
On Tuesday, August 17, 2010, Vitaly S. wrote: > Duncan Murdoch writes: > >> Vitaly S. wrote: >>> Martin Morgan writes: >>> > So,  can I be sure that for such functions parent.frame(2) will always > work? > What are the additional rules? > callNextMethod() will cause additio

Re: [Rd] parent.frame(1) of a S4 method is not a calling environment.

2010-08-17 Thread Vitaly S.
Duncan Murdoch writes: > Vitaly S. wrote: >> Martin Morgan writes: >> So, can I be sure that for such functions parent.frame(2) will always work? What are the additional rules? >>> callNextMethod() will cause additional problems; the idea that you'll >>> grab thin

Re: [Rd] parent.frame(1) of a S4 method is not a calling environment.

2010-08-17 Thread Duncan Murdoch
Vitaly S. wrote: Martin Morgan writes: So, can I be sure that for such functions parent.frame(2) will always work? What are the additional rules? callNextMethod() will cause additional problems; the idea that you'll grab things from somewhere other than function arguments doesn't se

Re: [Rd] parent.frame(1) of a S4 method is not a calling environment.

2010-08-16 Thread Vitaly S.
Martin Morgan writes: >> >> So, can I be sure that for such functions parent.frame(2) will always work? >> What are the additional rules? > > callNextMethod() will cause additional problems; the idea that you'll > grab things from somewhere other than function arguments doesn't seem > like a ro

Re: [Rd] parent.frame(1) of a S4 method is not a calling environment.

2010-08-16 Thread Martin Morgan
On 08/15/2010 02:39 PM, Vitaly S. wrote: > > Dear Developers, > > I wonder what are the parent.frame rules for methods. For ordinary functions > one > can call parent.frame() and be sure that it is the environment of a calling > function. With S4 aparently it is not the case. > > Here is what I

[Rd] parent.frame(1) of a S4 method is not a calling environment.

2010-08-15 Thread Vitaly S.
Dear Developers, I wonder what are the parent.frame rules for methods. For ordinary functions one can call parent.frame() and be sure that it is the environment of a calling function. With S4 aparently it is not the case. Here is what I have discovered by trial and error so far: > setClass("A",