lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

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
        local x=x
        f = function() return %x end

Peter Hill.