lua-users home
lua-l archive

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


Alexander Gladysh wrote:
My code generator sees data flow roughly as follows (pseudo-representation):

    label "A"
    command-1
    if condition-1 then goto label "B"
    goto label "A"
    label "B"
    command-2

That is, unconditonal jumps may be both up and down on command flow.

Use tail calls?

local A, B

A = function()
  command_1()
  if condition_1 then return B() end
  return A()
end

B = function()
  command_2()
end

--
Shmuel