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

track last-seen occurrence of Vars separately #73

Closed
wants to merge 2 commits into from

Conversation

gridaphobe
Copy link
Contributor

given a program

  let x = 0
  if cond {
    let x = 1
  } else {
    let x = x + 1
  }

we want to ensure that the RHS occurrence of x in the else-branch refers to the x outside of the if, not the x in the then-branch.

With a single copy of the symEnv we would introduce a new binder for x in the then-branch and then see refer to that binder in the else-branch, which is bogus. So, instead we keep a copy of the env that is used to lookup the last-seen instance of a Var, which we can reset after running a branch.

given a program

  let x = 0
  if cond {
    let x = 1
  } else {
    let x = x + 1
  }

we want to ensure that the RHS occurrence of `x` in the else-branch
refers to the `x` outside of the `if`, *not* the `x` in the true-branch.
@gridaphobe
Copy link
Contributor Author

This fixes #69, though it might be simpler to just use a global supply of fresh integers, rather than trying to track the count for each Var individually 😄

@leepike
Copy link
Contributor

leepike commented Oct 26, 2016

Closing this old pull request...

@leepike leepike closed this Oct 26, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants