Skip to content

Instantly share code, notes, and snippets.

@raiph
Created January 19, 2017 23:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save raiph/5c6ce5013ff4918eab1060472de4d891 to your computer and use it in GitHub Desktop.
Save raiph/5c6ce5013ff4918eab1060472de4d891 to your computer and use it in GitHub Desktop.
One body shared by multiple signatures (Tentative proposal for 6.d)
This is one of several gists I've written that relate to several distinct tentative proposals for 6.d that make sense both independently and together.
This gist discusses a long conjectured feature that would work nicely with the other proposals:
Others include:
* [Implicit/explicit mutation in 6.c]().
----
In 6.c one can write two methods thus:
multi method m (... --> self) {
...
}
multi method m (... --> SELF) {
... # body is identical to body of the `--> self` method above.
}
This proposal is to support:
multi method m (... --> self),
multi method m (... --> SELF) {
... # body is identical for both method signatures.
}
or something similar.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment