-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
rename colon
to :
, make other syntax call Base functions
#25957
Conversation
Finally.... |
Triage was tentatively in support, especially with Jeff's argument that this implements a very simple rule: if you see the name in the syntax, it's lexically scoped. If lowering introduces a new name, like how |
9df47fd
to
ec8c17f
Compare
ec8c17f
to
3afadd4
Compare
I'm all for this change. It would be nice to have a consistent mechanism for overriding non-obvious lowering names, though. The current names are |
There are more: The double underscore idea is not bad. We already do that for |
I should know better than to put 3 unrelated commits in the same PR. Will split these out. |
Fixes #25947.
I can't see much reason to have
:
callcolon
, so this changes it to be like other operators and parse as a call to:
.The next commit changes the lowering of syntax that corresponds to function names to be "hygienic", i.e. always call Base. A long time ago I thought it might be a feature that
a[i]
could call a local function calledgetindex
, but (1) that's probably not a good idea, and (2) we're not consistent about this, and most forms already called Base functions. This makes it totally consistent (unless I missed one).The first commit is just a simple lowering bugfix.