Syntax decision
Zhong Yu
zhong.j.yu at gmail.com
Fri Sep 30 02:53:12 PDT 2011
After even longer stare, ()-> looks fine to me; it fades in the background.
I was actually thinking about a case like
(http://gafter.blogspot.com/2006/12/super-type-tokens.html)
TypeReference<List<String>> x = new TypeReference<List<String>>() {};
=>
TypeReference<List<String>> x = ()->{};
which looks *really* bizzare. But now I know abstract class is not
supported, so the case is moot.
Zhong Yu
On Fri, Sep 30, 2011 at 12:43 AM, Brenden Towey <brendentowey at gmail.com> wrote:
> Actually the way you've formatted it here, I don't mind ()-> as a nullity
> lambda. Even the () looks a bit like a zero, which is a pretty good
> "nullity" if you ask me. Formatting it so it runs together makes it stand
> out. Trying to separate it with spaces might confuse the reader more.
>
> And I'm honestly uncertain of the value of some other symbol. Do you have a
> proposal?
>
>
>
> On 9/29/2011 10:11 PM, Zhong Yu wrote:
>>
>> Since 0-arg case is quite common, as in Runnable and Callable, we'll
>> have many use cases like
>>
>> cache.get(key, ()->load(key));
>>
>> Not bad after staring at them for 30 minutes. But too many consecutive
>> punctuation marks are there... quite dizzy at first sight.
>
>
>
>
More information about the lambda-dev
mailing list