Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nested do blocks do not work #20

Open
jw3126 opened this issue Jun 9, 2020 · 2 comments
Open

Nested do blocks do not work #20

jw3126 opened this issue Jun 9, 2020 · 2 comments
Labels

Comments

@jw3126
Copy link

jw3126 commented Jun 9, 2020

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
@c42f
Copy link
Owner

c42f commented Jun 13, 2020

Correct, this is a bug, thanks for the report.

@c42f c42f added the bug label Jun 13, 2020
@JTaets
Copy link

JTaets commented Jan 5, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants