Continuing to experiment with extension methods

Mark "Justin" Waks
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.

--

--

Mark "Justin" Waks
Mark "Justin" Waks

Written by Mark "Justin" Waks

Lifelong programmer and software architect, specializing in online social tools and (nowadays) Scala. Architect of Querki (“leading the small data revolution”).

No responses yet