Updated State of the Lambda

Brian Goetz brian.goetz at oracle.com
Mon Dec 12 11:04:12 PST 2011


Yes, we did (as well as "default abstract", for the same reason.)  While 
these have the benefit of saving a "keyword", "default null" makes it 
less obvious what is meant, as does "default abstract".  The overhead of 
a contextual keyword seems worth the clarity benefit.

I think you have to squint pretty hard to see this as "conveying the 
appropriate meaning".  I would think no one would suggest this except 
for its keyword-conservation properties; that's a giveaway that you're 
hammering a square peg into a round hole.

On 12/12/2011 1:41 PM, Henri Gerrits wrote:
>> and you need 'default none' to re-abstract a method of an interface,
>> i.e. to say I don't want to inherits from the default implementation.
>>
>> interface I {
>>    void m() default { ... }
>> }
>> interface J extends I {
>>    void m() default none;
>> }
>> class A implements J {
>>    // don't compile, you need to provide a code for m()
>> }
>>
>> Because methods defined in an interface are always abstract,
>> you can't use abstract instead of default none.
>>
> Have you considered 'default null'?  It will save a keyword - even if it is only a local one - and it conveys the appropriate meaning (compare this to setting a variable to null to indicate that the referred to object is no longer needed).
>
> Best regards,
>
> Henri
>


More information about the lambda-dev mailing list