[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: global keyword instead of local
- From: Christian Vogler <cvogler@...>
- Date: Wed, 13 Sep 2000 12:22:11 -0400
On Wed, Sep 13, 2000 at 12:04:25PM +0100, Reuben Thomas wrote:
> > Incidentally, the scoping rules of both Lua and Python also mean
> > that defining recursive local functions is not straightforward,
> > because the variable holding the function object is not visible to
> > the function!
> This too is awkward in Lua, and having full lexical scoping (and removing
> the rather awkward "upvalues") would be good. What's the problem with
> passing non-fixed environments around with closures?
I have speculated, too, about the reasons why lua does not do it, and
I suspect that it is a tradeoff for speed. You would need to allocate
such environments on the heap, and that can be very costly.