-
Notifications
You must be signed in to change notification settings - Fork 98
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Recursive let #681
Recursive let #681
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The implementation looks good, but this PR could benefit from a tad more tests and documentation, see inline comments.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the free variable tests, I was thinking about adding something like:
#[test]
fn recursive_let() {
assert!(check_stat_vars(
"{
a = let rec b = b + a + h in b,
b = let rec a = a + b in f (a + 1) z,
c = let rec foo = b in let rec bar = c in if a.r then [b] else {foo = c}
}",
HashMap::from([
("a", vec!["a"]),
("b", vec!["b"]),
("c", vec!["a", "b", "c"])
])
));
}
in tests/free_var.rs
. This checks that the free_var transform correctly handles the case of recursive lets bindings.
Resolves #525. Unfortunately, this PR adds "rec" as a keyword, meaning that tests that use "rec" as a shorthand for "record" were changed to use "r" instead.