?sys.parent (and friends)
-- Bert
On Thu, Sep 5, 2013 at 4:37 PM, ivo welch wrote:
> quick question. how do I search up the calling environments until I find a
> variable?
>
> > x=function() { m=22; y() }
> > y=function() { z() }
> > z=function() { mget("m", inherits=TRUE, ifnotfound="m not f
quick question. how do I search up the calling environments until I find a
variable?
> x=function() { m=22; y() }
> y=function() { z() }
> z=function() { mget("m", inherits=TRUE, ifnotfound="m not found") }
> x()
$m
[1] "m not found"
from the perspective of z(), function x is not an enclosing en
2 matches
Mail list logo