Re: [Rd] Capturing environment associated with a promise

From: Duncan Murdoch <murdoch.duncan_at_gmail.com>
Date: Mon, 08 Oct 2012 09:50:50 -0400

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



R-devel_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Mon 08 Oct 2012 - 13:53:13 GMT

This quarter's messages: by month, or sorted: [ by date ] [ by thread ] [ by subject ] [ by author ]

All messages

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Mon 08 Oct 2012 - 14:40:46 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-devel. Please read the posting guide before posting to the list.

list of date sections of archive