lua-users home
lua-l archive

[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