lua-users home
lua-l archive

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


paul@thev.net writes:

> In case you really miss this, here is how we do it in our game:

...

> function mk_func(func, ...)
>     local args = arg
>     return function(...)
>                 join_array(%args, arg)
>                 call(%func, %args)
>            end
> end

When Lua variables have static nested scoping, you'll be able to write
the same thing without the percent syntax.  

function mk_func(func, ...)
    local args = arg
    return function(...)
                join_array(args, arg)
                call(func, args)
           end
end

This is surely nicer, but not the best example for showing why static
nested scoping is superior.

John