Re: Sharing locals with a function created using "load"
[
Date Prev][
Date Next][
Thread Prev][
Thread Next]
[
Date Index]
[
Thread Index]
- Subject: Re: Sharing locals with a function created using "load"
- From: tomas <tomas@...>
- Date: 2015年5月04日 14:08:11 -0300
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