lua-users home
lua-l archive

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


On Thursday 13, Vadim Peretokin wrote:
> Nope, my bad - I actually do
>
> t = {
>    foo = function() end,
>    bar = function () some_global_function(t.foo) end,
> }

if some_global_function() should only be called once, then you would need to 
do:
t = {
   foo = function() end,
   bar = function () t.bar = some_global_function(t.foo); return t.bar end,
}

-- 
Robert G. Jakabosky