FastClosures.jl
FastClosures.jl copied to clipboard
Nested do blocks do not work
using FastClosures
outer = [[1]]
@closure map(outer) do inner
map(inner) do x
x + 1
end
end
UndefVarError: x not defined
The reason is, that @closure thinks x is a variable from outer scope:
quote
let x = x
map(outer) do inner
map(inner) do x
x + 1
end
end
end
end
Correct, this is a bug, thanks for the report.
Any kind of nested structure doesn't work
_c = 5
@closure (_a) -> ((_b) -> _a+_b+_c)
This gives an error that _b should be defined