Skip to content
Prev 47626 / 63424 Next

getting environment from "top" promise

Hello, 

We have something very similar to your while loop in dplyr. 
https://github.com/hadley/dplyr/blob/02a609310184d003c2ae9e0c013bfa69fa4d257a/inst/include/tools/DataDots.h#L15

because we need to know exactly in which environment a promise is supposed to be evaluated, even though we might combine standard R evaluation with an alternative faster engine. this is the basis of what we called hybrid evaluation. 


For future work, I also have the while loop in the Promise class in Rcpp11, so that when you create a Promise in Rcpp11, its .environment() method gives you what you expect. 
https://github.com/romainfrancois/Rcpp11/blob/master/inst/include/Rcpp/Promise.h#L14 

So, this is something I find useful, although I?m not sure we are supposed to mess with promises. 

Romain

Le 11 f?vr. 2014 ? 19:02, Michael Lawrence <lawrence.michael at gene.com> a ?crit :