-
Notifications
You must be signed in to change notification settings - Fork 15
Enforce let-punning in the janestreet profile #70
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
Conversation
ccasin
left a comment
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.
I read this and it looks fine to me (modulo questions below). But I'm going to hold off on approving until we've had a chance to test it on the tree because we could easily be missing some corner case.
ccasin
left a comment
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.
Approved, but will let David merge when he's ready.
rewrite [let%foo bar = bar in ...] to [let%foo bar in] whenever possible includes tests for comments and some corner cases where it is better not to pun Signed-off-by: David Vulakh <dvulakh@janestreet.com>
Signed-off-by: David Vulakh <dvulakh@janestreet.com>
Signed-off-by: David Vulakh <dvulakh@janestreet.com>
Signed-off-by: David Vulakh <dvulakh@janestreet.com>
Signed-off-by: David Vulakh <dvulakh@janestreet.com>
Signed-off-by: David Vulakh <dvulakh@janestreet.com>
Signed-off-by: David Vulakh <dvulakh@janestreet.com>
Signed-off-by: David Vulakh <dvulakh@janestreet.com>
Signed-off-by: David Vulakh <dvulakh@janestreet.com>
d54c9a3 to
28556e4
Compare
Whenever it is possible to "pun" a
let-binding, do so.We do this for any
letbinding that is an extension or an operator and where the LHS and RHS are just the same identifier (no attached attributes, no type annotations).I've added tests for a few tricky cases to
let_punning.ml. I've also tested internally, and our styler runs without producing any syntax errors. More thorough testing will need to wait for the parser fix in compiler PR #2612.