updated syntax for method references
Sven Efftinge
sven at efftinge.de
Fri Mar 2 06:16:42 PST 2012
It doesn't say anything about member literals, does it?
I meant something along the lines of the class literal where you'd get the java.lang.reflect instance.
I.e.
Foo#bar
would be a statically typed version of
Foo.class.getDeclaredFields("bar")
Sven
On Mar 2, 2012, at 2:10 PM, Rémi Forax wrote:
> On 03/02/2012 01:54 PM, Sven Efftinge wrote:
>> Hi,
>> could you elaborate on what ideas you have for the '#' syntax?
>> Something like member literals?
>
> yes,
> see section 8,
> http://cr.openjdk.java.net/~briangoetz/lambda/lambda-state-4.html
>
> Rémi
>
>>
>> Sven
>>
>> On Mar 2, 2012, at 12:05 PM, Maurizio Cimadamore wrote:
>>
>>> Hi,
>>> I recently pushed a changeset to remove support for '#'-based syntax for
>>> _method references_ (the commit message is confusing, I pushed too fast
>>> ;-)). This means that the long standing syntax for method references:
>>>
>>> Foo#bar
>>> new Foo()#bar
>>> super#bar
>>>
>>> is now not supported anymore. Instead, the compiler accepts a similar
>>> infix variant, where '#' is replaced by '::' - this has been available
>>> for quite some time, and it is also the syntax used in all recent
>>> documentation:
>>>
>>> Foo::bar
>>> new Foo()::bar
>>> super::bar
>>>
>>> The syntax discussion regarding method references is still ongoing with
>>> the EG - so this push doesn't mean we are 100% committed to the '::'
>>> syntax - on the other hand we are fully committed _not to_ have the '#'
>>> syntax, as we envisage better usages for such token in future releases.
>>>
>>> Maurizio
>>>
>>>
>>
>
>
More information about the lambda-dev
mailing list