From murdoch.duncan at gmail.com  Mon Oct  8 15:50:50 2012
From: murdoch.duncan at gmail.com (Duncan Murdoch)
Date: Mon, 08 Oct 2012 09:50:50 -0400
Subject: [Rd] Capturing environment associated with a promise
In-Reply-To: <CABdHhvHGm8qABh7XWeMNCA9qLUFEf1ksJaf0NDH_xhyHK=jtpw@mail.gmail.com>
References: <CABdHhvHGm8qABh7XWeMNCA9qLUFEf1ksJaf0NDH_xhyHK=jtpw@mail.gmail.com>
Message-ID: <5072DA3A.2030709@gmail.com>

On 12-10-08 9:22 AM, Hadley Wickham wrote:
> Hi all,
>
> It's possible to capture the expression associated with a promise
> (using substitute). Is there any way to capture the environment
> associated with a promise?  Similarly, is there any way to tell if
> something is a promise without accidentally evaluating it?


Neither of those is possible in user-level code.  The special functions 
get to see their arguments unevaluated, but users can't write specials, 
and there is no special to extract an environment from a promise.

I think the reasoning is that it keeps the semantics simpler, but I 
can't remember the cases that make user-level promise handling problematic.

Duncan Murdoch



[Rd] Capturing environment associated with a promise
Duncan Murdoch