[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: functional programming-like closures
- From: ramsdell@... (John D. Ramsdell)
- Date: 10 Sep 2001 09:56:40 -0400
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