proposal-extensions icon indicating copy to clipboard operation
proposal-extensions copied to clipboard

Rename the proposal from "extensions" to "static dispatch operator"

Open hax opened this issue 3 years ago • 0 comments

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, has receiver::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 and a["foo"] which resolve the method/function dynamically.

As such renaming, Symbol.extension will also be renamed to Symbol.dispatcher.

hax avatar Jun 02 '22 04:06 hax