Concise method bodies with delegation and this
Brian Goetz
brian.goetz at oracle.com
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?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.java.net/pipermail/amber-spec-experts/attachments/20190318/ef38e70a/attachment-0001.html>
More information about the amber-spec-experts
mailing list