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

Promote mutables to refs when captured by closures #323

Open
kevmal opened this issue Sep 10, 2019 · 0 comments
Open

Promote mutables to refs when captured by closures #323

kevmal opened this issue Sep 10, 2019 · 0 comments

Comments

@kevmal
Copy link
Contributor

kevmal commented Sep 10, 2019

Need to check on the erased case. But for the generated case

<@
    let mutable a = 0
    let f() = a <- a + 1
    f()
    a
@>

will return 0. In the short term there should at least be an error.

Otherwise perhaps the best place to fix this would be in QuotationSimplifier. Each mutable let could traverse down its body to check for references and then rewrite the Expr with a ref type if needed.

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

No branches or pull requests

2 participants