[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: AW: Making Lua lexically scoped (was: Re: Proper tail recursion)
- From: "Peter Prade" <prade@...>
- Date: Mon, 30 Jul 2001 15:41:24 +0200
Jay Carlson comments on John Ramsdell:
>> By the way, the more I think about the suspected Python method for
>> making that language lexically scoped, the more I like it. That is, I
>> like the idea that a language is lexically scoped, but as sacrifice to
>> allow efficient implementations, variables become immutable whenever
>> they are referenced by a closure.
>This gives me the creeps. To understand whether something is writable or
>not you can't just look at its declaration; you have to inspect all of the
>code inside its defining block.
I wholeheartedly agree, the current solution at least clearly marks those
upvalues as something special and readonly.
In my personal opinion, the current solution of upvalues in lua is quite
The only thing i'd like to see is upvalues from more than 1 level above:
print(%var) -- or, as an uglier solution: print(%%var)
currently, you have to propagate such values by hand:
local _var = %var
just my 2 (euro)cents,