2 ms·
a straightfoward translation of the Javascript version w/ closures should work function goal(n) return function(al) if al then
by ufo 12y ago
a straightfoward translation of the Javascript version w/ closures should work
function goal(n)
return function(al)
if al then
return "G" .. string.rep("o", n) .. al
else
return goal(n+1)
end
end
end
G = goal(0)
print( G()()('al') )
Also note that G()'al' is just syntactic sugar for G()('al') in Lua