[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Lua5.0 new "For" question
- From: "Peter Hill" <corwin@...>
- Date: Mon, 23 Dec 2002 19:20:02 -0000
Vincent Penne:
> Now I understand that the % is just for "compatibility", but now I would
> say that it is a bit dangerous because not actually truely compatible.
> One way to get original lua 4 behaviour was
> local x=123
> do
> local x = x
> f = function() return %x end
> end
> x = 456
> print (f())
It sounds like, if "%" is still going to be kept (rather than just
outlawed), then its default behaviour should be changed to reflect its old
usage. Ie:
local x
f = function() return %x end
should simply be a shorthand for
local x
do
local x=x
f = function() return %x end
end
*cheers*
Peter Hill.