From murdoch.duncan at gmail.com  Sat Oct  2 15:18:18 2010
From: murdoch.duncan at gmail.com (Duncan Murdoch)
Date: Sat, 02 Oct 2010 09:18:18 -0400
Subject: [Rd] Eval and the enclos argument
In-Reply-To: <AANLkTinQ8fXByLEkJqCFOr9i4Q5KNSnf2cfAD0vBJy-6@mail.gmail.com>
References: <AANLkTinQ8fXByLEkJqCFOr9i4Q5KNSnf2cfAD0vBJy-6@mail.gmail.com>
Message-ID: <4CA7311A.1000304@gmail.com>

On 02/10/2010 7:57 AM, Hadley Wickham wrote:
> Hi all,
> 
> I'm trying to understand the default value of the enclos argument of eval:
> 
>   enclos = if(is.list(envir) || is.pairlist(envir)) parent.frame()
> else baseenv()
> 
> Why isn't it just
> 
>   enclos = parent.frame()
> 
> given that enclos is only meaningful (given my reading of the
> documentation) when envir is not an environment already.
> 
> Hadley
> 


I think that handles the case of envir=NULL.

Duncan Murdoch



[Rd] Eval and the enclos argument
Duncan Murdoch