Re: [Rd] Capturing environment associated with a promise

2012-10-09 Thread Hadley Wickham
Promises are an implementation detail -- we need to be able to change them, optimize them away, etc, so there is a limit on what we want to expose. Allowing a query of whether a binding is delayed or not should be OK but would want to think that through more carefully before committing to

Re: [Rd] Capturing environment associated with a promise

2012-10-09 Thread Hadley Wickham
Both of these are possible in C. See: https://stat.ethz.ch/pipermail/r-devel/2007-September/046943.html Cool, thanks. It shows how to query an object to see if its a promise and but rather than extract the environment it shows how to copy a promise without evaluating it; however, it was

[Rd] Capturing environment associated with a promise

2012-10-08 Thread Hadley Wickham
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? Thanks! Hadley -- RStudio /

Re: [Rd] Capturing environment associated with a promise

2012-10-08 Thread Duncan Murdoch
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

Re: [Rd] Capturing environment associated with a promise

2012-10-08 Thread luke-tierney
Promises are an implementation detail -- we need to be able to change them, optimize them away, etc, so there is a limit on what we want to expose. Allowing a query of whether a binding is delayed or not should be OK but would want to think that through more carefully before committing to this.

Re: [Rd] Capturing environment associated with a promise

2012-10-08 Thread Gabor Grothendieck
On Mon, Oct 8, 2012 at 9:22 AM, Hadley Wickham h.wick...@gmail.com 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