Continuing to experiment with extension methods
1 min readJun 27, 2019
Today in Dotty news is a PR from Martin, replacing the prefix-style syntax for extension methods:
def (c: Circle) circumference: Float = ...
with the keyword this
instead:
def circumference(this: Circle): Float = ...
Personally, I prefer the prefix format (I find it more visually distinct), but it’s worth experimenting before it sets in stone. If you are interested, you may want to check out the thread on the PR…
ETA (July 5): this experiment has been closed, after a good deal of discussion, but as of this writing, the discussion of which alternative we should pursue is still ongoing.