-
Notifications
You must be signed in to change notification settings - Fork 452
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
branching on function name #1719
Comments
The namespace of functions is different from the namespace of labels and |
My question was rather if there was a reason to forbid it as I believe it should be easy to support (as I wrote an alternative semantics which allows it). My understanding is that in the current semantics, nothing prevents it and only the text format support is missing. I'm not familiar with the formal description of the text format but it seems it could be possible by adding a new label entry containing the function's identifier in this rule. I'm not sure to fully understand this rule for now so I may be wrong. |
Yes, that's true. It would certainly be technically possible to extend the text format to allow the function name to be used as a label. Besides the fact that we don't have any other names that are usable in more than one namespace, I can't think of any other reason to forbid this. @rossberg, what do you think? This might be a nice quality of life improvement in the text format. |
Yes, that would be relatively easy to add. It would even be a non-breaking change, since we allow shadowing of labels, so existing code like
would continue to be legal. |
@rossberg, if we want to make this change, perhaps you can publicize it briefly at an upcoming CG meeting and then make the change via PR? I doubt anyone would insist on a more heavyweight process here. |
Given that he proposed it, I'd suggest @zapashcanon also presents it. Happy to review a PR as well. :) |
Fine with me for the CG meeting. I can do the PR for the interpreter, and I'll try my best for updating the semantics (the current format is not as easy to understand as spectec :-)) |
Hi,
Consider the following module:
Running the interpreter gives:
Whereas the following module succeeds:
I'm wondering what was the reason for forbidding using the function name directly ?
The text was updated successfully, but these errors were encountered: