[Rd] Capturing environment associated with a promise
murdoch.duncan at gmail.com
Mon Oct 8 15:50:50 CEST 2012
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.
More information about the R-devel