Default method survey results

Maurizio Cimadamore maurizio.cimadamore at oracle.com
Thu Aug 16 03:48:14 PDT 2012


On 16/08/12 11:03, Stephen Colebourne wrote:
> So for me, there are two valid designs:
>
> // full option - exact parallel to abstract classes
> // "only default interfaces can have default methods"
> default interface {
>    <method_no_body>
>    default <method_with_body>
> }
>
> // minimal option - no cruft
> // "as simple as possible"
> interface {
>    <method_no_body>
>    <method_with_body>
> }
>
> The current lambda option feels like a messy halfway house:
> interface {
>    <method_no_body>
>    default <method_with_body>
> }
Point taken, thanks for clarifying your point - the fact that this whole 
thread has been focussed on the 'why don't you leave the D-word out' 
rather than on the 'why don't you add the D-word on the interface too' 
probably contributed biasing the discussion too.

I think a keyword on the interface would not be that alien, as both the 
compiler and the VM are synthesizing a flag to mark 'interfaces with 
default methods'. Your proposal is about making this logic explicit 
(since everything else is explicit too).

Let's keep this on the back of our mind for a while and see how it pan out.

Maurizio





More information about the lambda-dev mailing list