Closed hax closed 1 week ago
I plan to change the syntax to dot based (eg. receiver.x'foo
), so let's keep the word "extensions".
x'foo
could be seen as a "compound identifier" which is two identifiers combined by the separator, so the proposal name might become "extensions and compound identifier".
Currently the proposal is named as "Extensions and
::
operator". I'm considering rename it to "static dispatch operator" (contrasts with.
and[]
, which are dynamic dispatch operators).Though extension methods/accessors are the important motivation/use cases of the proposal, there are also other motivation/use cases. For example utilize
::
operator to get good syntax for first-class protocol and static invoking in the classes.Another issue is not every people know extensions concept well, and it also has different with extensions of other programming languages (use
::
operator instead of.
operator, hasreceiver::X:foo
form).So renaming the proposal to "static dispatch operator" could give the more precise description --- provide a form of method dispatch which resolve the method/function statically, contrasts with
a.foo
anda["foo"]
which resolve the method/function dynamically.As such renaming,
Symbol.extension
will also be renamed toSymbol.dispatcher
.