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

More complex cases will fail #20

Open
thautwarm opened this issue Sep 13, 2019 · 1 comment
Open

More complex cases will fail #20

thautwarm opened this issue Sep 13, 2019 · 1 comment
Labels
bug Something isn't working help wanted Extra attention is needed question Further information is requested

Comments

@thautwarm
Copy link
Member

thautwarm commented Sep 13, 2019

Some known cases and workaround:

When a let binding LHS symbol is a denoting mutable shared variable.

@gg test() = quote
function (x)
    let x = x
            y -> begin
                   x = x + 1
                   x
            end
    end
end
end

workaround: currently, do not mutate a free variable, or box it in Ref or Core.Box:

@gg test() = quote
function (x)
    let x = Ref(x)
            y -> begin
                   x[] = x[] + 1
            end
    end
end
end

Generators

@gg test() = quote
  seq -> :(x+1 for x in seq) 
end

workaround: do not use generator syntax, try to abstract it outside:

@inline gen(seq) = (x + 1 for x in seq)
@gg test() = quote
  gen(seq)
end
@thautwarm thautwarm added bug Something isn't working help wanted Extra attention is needed question Further information is requested labels Sep 13, 2019
@thautwarm
Copy link
Member Author

The let binding problem is solved in branch 0.2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant