[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: A review of changes between 5.1 and 5.2-work3
- From: Roberto Ierusalimschy <roberto@...>
- Date: Thu, 20 May 2010 13:59:21 -0300
> Roberto Ierusalimschy wrote:
> >If the function collaborates (that is, it has been written to have
> >a variable environment), my preferred idiom is to pass the environment
> >as an argument and to get it in a parameter called _ENV in the function.
> >
> > function foo (_ENV, a, b, c)
> > -- code will run in the environment given as first argument
> > ...
> > end
>
> Perfect for all my uses :-)
> Is _ENV inherited by functions called from foo()?
No. It is a perfectly regular variable. But functions *declared* inside
foo will see it (like any other variable).
-- Roberto