On 23/07/15 05:42 AM, Geoff Leyland wrote:
Hi,Use arguments.
Is there a trick to writing a pair of mutually recursive functions such that
both functions end up being held in one-time-assigned local variables? The
following:
local two
local function one(count)
count = count - 1
if count > 0 then return two() end
end
two = function(count)
count = count - 1
if count > 0 then return one() end
end
means that (as I understand it) two cannot be proven constant, and so the code
generated is not as quick as it could be. (I haven’t actually done any
checking in this case, I’m just interested in whether there’s a simple answer).
Geoff