Latest draft of Defender Methods

Brian Goetz brian.goetz at oracle.com
Mon Aug 16 14:09:34 PDT 2010


You are technically correct, if our goal was to strip the syntax down to the 
absolute minimum, "extension" would not be needed.  Several people on this 
list have already expressed the same viewpoint.  And you are correct that 
extension methods can be used an on interface from day 1, without a 
pre-existing implementation.  We believe, at this point, that the extra token 
adds sufficient value to leave the proposal as-is.

As has been stated before, though, we would prefer to not engage in 
discussions over syntax when there are so much more important things to 
discuss.  Syntax discussions are like an invasive species; once they get root, 
nothing else gets any oxygen.  Trust that we've noted this concern and we've 
filed it away for future consideration when we are convinced we've covered the 
more important bits, like, "does this work", "is this a good idea", "can we 
implement it", "how does this interact with other language features", "how 
should conflicts be resolved", "what will the performance be like", "what is 
the specification impact", "can we make our schedule", etc.

Cheers,
-Brian


On 8/16/2010 3:31 PM, Paul Benedict wrote:
> Brian,
>
> I believe the need for the "extension" keyword is superfluous. Correct
> me if wrong, but you don't actually need an existing interface to use
> defender methods, right? I create a brand new interface with all default
> implementations provided? If so, then I put forth my opinion to remove
> the keyword. The use of "default" is enough -- the use of "extension"
> implies a use case that's not necessarily true: I don't need to augment
> an existing interface to add default methods.
>
> Paul
>
> On Mon, Aug 16, 2010 at 2:01 PM, Brian Goetz <brian.goetz at oracle.com
> <mailto:brian.goetz at oracle.com>> wrote:
>
>     I've posted a new draft of Defender Methods at:
>
>     http://cr.openjdk.java.net/~briangoetz/lambda/Defender%20Methods%20v3.pdf
>     <http://cr.openjdk.java.net/%7Ebriangoetz/lambda/Defender%20Methods%20v3.pdf>
>
>
>


More information about the lambda-dev mailing list