lua-users home
lua-l archive

Re: Sharing locals with a function created using "load"

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


Hi Ignacio
Can't you use upvalues as in the code below:
function generate (key)
 local debug_message = "RLC "..key
 return function (cpu)
 logger.debug(debug_message)
 cpu[key] = RLC(cpu, cpu[key])
 cpu.PC = (cpu.PC + 2) & 0xffff
 end
end
It seems simpler to me...
Regards,
Tomás

AltStyle によって変換されたページ (->オリジナル) /