Skip to content

Instantly share code, notes, and snippets.

@mathias
Last active September 20, 2019 03:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mathias/7f221a2174ac0cef1cc956882d4aab39 to your computer and use it in GitHub Desktop.
Save mathias/7f221a2174ac0cef1cc956882d4aab39 to your computer and use it in GitHub Desktop.
(local tbl {:foo (fn [] "bar")})
(fn qux [f]
(each [e f]
(print e))) ; where my code has the bug
(fn baz []
(if tbl.foo
(let [result (tbl.foo)]
(print result)
(qux tbl))))
(baz)
local function _0_()
return "bar"
end
local tbl = {foo = _0_}
local function qux(f)
for e in f do
print(e)
end
return nil
end
local function baz()
if tbl.foo then
local result = tbl.foo()
print(result)
return qux(tbl)
end
end
return baz()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment