Concise method bodies with delegation and this

Brian Goetz brian.goetz at
Mon Mar 18 15:19:19 UTC 2019

> There are two syntaxes, the arrow syntax and the colon-colon syntax, i think there is consensus that the arrow syntax (the one Brian uses) is nice and convenient.

I don’t really even think there’s consensus there; it is nice and convenient and mostly unobjectionable, but some felt “meh, what’s the point”, as it merely eliminates a few characters of typing.  

The implementation-by-delegation sub feature is far more substantial; it allows you to implement a class by wiring its declarations to existing reusable behaviors.  This has far more potential benefit, but also more cost.  

> - using '=' to set a concise method make the syntax easy to confound with a field initialization (something which is ok in Scala because the Scala syntax also blur that distinction between a method call and a field access, it's less  ok in Java IMO). 

Please, can we not harp on notation unnecessarily?  

> I really dislike the notation

Please, can we not harp on notation unnecessarily?

More information about the amber-spec-observers mailing list