[Rd] sys.function(0)

peter dalgaard pdalgd at gmail.com
Mon Mar 28 14:30:18 CEST 2016


Dunno, really. Some strange things can happen with nonstandard evaluation, like having a function designed to evaluate something in the parent of its caller, but nonetheless sometimes being called from the command line. So things are sometimes defensively coded.

-pd

> On 28 Mar 2016, at 00:08 , Mick Jordan <mick.jordan at oracle.com> wrote:
> 
> A related question is why are sys.parent/parent.frame so permissive in their error checking? E.g:
> 
> > sys.parent(-1)
> [1] 0
> > sys.parent(-2)
> [1] 0
> > sys.parent(1)
> [1] 0
> > sys.parent(2)
> [1] 0
> > parent.frame(4)
> <environment: R_GlobalEnv>
> >

-- 
Peter Dalgaard, Professor,
Center for Statistics, Copenhagen Business School
Solbjerg Plads 3, 2000 Frederiksberg, Denmark
Phone: (+45)38153501
Office: A 4.23
Email: pd.mes at cbs.dk  Priv: PDalgd at gmail.com



More information about the R-devel mailing list