-
Notifications
You must be signed in to change notification settings - Fork 0
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
Return currently uses the same syntax as labels #2
Comments
In order to make this change backwards compatible in cases where return is the last statement, the last statement could be implicitly returned just like in Rust. |
I just realized it basically already works like this. It's just enforced to call the label before the return value "return". This is bad for refactoring. Look at the For example this:
It's not possible. Instead you would have to rename every "goto return" to "goto end", also rename label "return" to "end" and add a new label "return" before x. So being allowed to use "return" as a label for "goto" while enforcing "return" to be the label before the return value at the end, might not be a good idea. |
Yes I do think you raise a good point about ease of refactoring. Instead of the three steps you mention, it's just two: adding a new label before the added instructions, and changing all the |
I think, removing the
:
afterreturn
would be less confusing.The text was updated successfully, but these errors were encountered: