From pdalgd at gmail.com  Mon Mar 28 14:30:18 2016
From: pdalgd at gmail.com (peter dalgaard)
Date: Mon, 28 Mar 2016 14:30:18 +0200
Subject: [Rd] sys.function(0)
In-Reply-To: <56F859EC.20602@oracle.com>
References: <56F83CF4.3050900@oracle.com>
	<74C577BC-7127-4D7A-A839-0ADFBB569A30@gmail.com>
	<56F859EC.20602@oracle.com>
Message-ID: <ED002551-0D7E-4D0C-91D8-3D04F38367BC@gmail.com>

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



[Rd] sys.function(0)
peter dalgaard