Implicit 'this' return for void methods

Guy Steele guy.steele at oracle.com
Tue Apr 1 16:37:21 UTC 2014


Then it sounds as if the three of us, at least, are very much in agreement about what is the appropriate scope for such a “naked dot” feature.

—Guy

On Apr 1, 2014, at 7:26 AM, Ulf Zibis <Ulf.Zibis at CoSoCo.de> wrote:

> 
> Am 01.04.2014 11:28, schrieb Bruce Chapman:
>> Slightly preceding Ulf's coin proposal by a few hours was
>> 
>> http://mail.openjdk.java.net/pipermail/coin-dev/2009-March/001134.html
>> 
>> Where I suggested the "naked dot" notation (coined in http://mail.openjdk.java.net/pipermail/coin-dev/2009-March/000855.html) has better value as ".. a
>> syntax for referring to the receiver of a method inside arguments to the
>> method."
>> 
>> More formally, the naked dot  (at the start of an expression, not following an invocation to a void method) would refer to the receiver of the innermost surrounding invocation expression.
>> 
>> and so to answer Guy's question below in terms of my original intention rather than Ulf's proposal, .indexof("Q") would use myVeryLongNamedString as its receiver.
> 
> +1
> My proposal was meant exactly as that. Maybe my wording was not clear enough in that.
> 
> -Ulf
> 




More information about the core-libs-dev mailing list