<html><body><div style="font-family: arial, helvetica, sans-serif; font-size: 12pt; color: #000000"><div><br></div><div><br></div><hr id="zwchr" data-marker="__DIVIDER__"><div data-marker="__HEADERS__"><blockquote style="border-left:2px solid #1010FF;margin-left:5px;padding-left:5px;color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt;"><b>De: </b>"Brian Goetz" <brian.goetz@oracle.com><br><b>À: </b>"Remi Forax" <forax@univ-mlv.fr><br><b>Cc: </b>"amber-spec-experts" <amber-spec-experts@openjdk.java.net><br><b>Envoyé: </b>Lundi 18 Mars 2019 16:19:19<br><b>Objet: </b>Re: Concise method bodies with delegation and this<br></blockquote></div><div data-marker="__QUOTED_TEXT__"><blockquote style="border-left:2px solid #1010FF;margin-left:5px;padding-left:5px;color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt;"><div><blockquote class=""><div class=""><div style="caret-color: rgb(0, 0, 0); font-family: arial, helvetica, sans-serif; font-size: 16px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><div class="">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.</div></div></div></blockquote><div><br class=""></div>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. </div></blockquote><div><br></div><div>Especially if you still have a big javadoc comment as Kevin said.<br data-mce-bogus="1"></div><div>I think this feature shine when you override a method, because the semantics is already defined (usually you don't need any javadoc), the poster child being implementing Comparable as Victor said.<br data-mce-bogus="1"></div><div><br data-mce-bogus="1"></div><div>And BTW, i still think we should come with a shorter syntax for overridden method by allowing to not declare parameter types like with a lambda,</div><div> class Person implement Comparable<Person> {<br data-mce-bogus="1"></div><div> private final int id;<br data-mce-bogus="1"></div><div> // more fields<br data-mce-bogus="1"></div><div><br data-mce-bogus="1"></div><div> override equals(o) -> (o instanceof Person p)? p.id == id : false;<br data-mce-bogus="1"></div><div> override hashCode() -> id;<br data-mce-bogus="1"></div><div> override compareTo(p) -> Integer.compare(id, p.id);<br data-mce-bogus="1"></div><div> }<br data-mce-bogus="1"></div><div><br data-mce-bogus="1"></div><blockquote style="border-left:2px solid #1010FF;margin-left:5px;padding-left:5px;color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt;"><div><br class=""></div><div>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. </div></blockquote><div><br></div><div>yes, but i believe part of the cost is because the current proposed syntax is reusing the syntaxic operators = and :: but with a slightly different semantics.<br></div><div><br data-mce-bogus="1"></div><div><br data-mce-bogus="1"></div><blockquote style="border-left:2px solid #1010FF;margin-left:5px;padding-left:5px;color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt;"><div><br class=""><blockquote class=""><div class=""><div style="caret-color: rgb(0, 0, 0); font-family: arial, helvetica, sans-serif; font-size: 16px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><div class="">- 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). </div></div></div></blockquote><div><br class=""></div>Please, can we not harp on notation unnecessarily? </div></blockquote><div><br></div>i disagree here because i think that the proposed syntax is part of the issue<br></div><div data-marker="__QUOTED_TEXT__"><br><blockquote style="border-left:2px solid #1010FF;margin-left:5px;padding-left:5px;color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt;"><div><br class=""><blockquote class=""><div class=""><div style="caret-color: rgb(0, 0, 0); font-family: arial, helvetica, sans-serif; font-size: 16px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><div class="">I really dislike the notation</div></div></div></blockquote><div><br class=""></div>Please, can we not harp on notation unnecessarily?</div></blockquote><div><br></div><div>fair point for this one.<br></div><div><br data-mce-bogus="1"></div><div>Rémi<br data-mce-bogus="1"></div><div><br data-mce-bogus="1"></div></div></div></body></html>