Allow lambdas to implement abstract classes

Paul Sandoz paul.sandoz at oracle.com
Fri Mar 1 06:23:47 PST 2013


On Mar 1, 2013, at 2:10 PM, Howard Lovatt <howard.lovatt at gmail.com> wrote:
> I remember the previous discussion and just retread it to be sure. The issue raised is with constructors that take arguments or throw checked exceptions.

Or constructors that execute code with some side-effects.


> You could limit the lambdas to either functional abstract classes that:
> 
> 1. Do not have any user supplied constructors
> 2. Either 1 above or has a user supplied no-arg constructor that does no throw a checked exception
> 

And super classes need to be taken into account.

Functional Interfaces are dead simple to grok. 

Including a restricted form of class that is a functional abstract class adds another dimension for developers, compilers, runtime and tools to understand. Is it worth it?

Paul.

> Option 1. Is the most conservative, would the be an objection to 1. 
> 
> -- Howard. 
> 
> Sent from my iPad
> 
> On 01/03/2013, at 9:19 PM, Paul Sandoz <paul.sandoz at oracle.com> wrote:
> 
>> Hi Howard,
>> 
>> Abstract classes have constructors that will execute user code and thus they can observe and interfere with the process of bootstrapping the lambda expressions. See the following thread for more details:
>> 
>> http://mail.openjdk.java.net/pipermail/lambda-dev/2012-November/006436.html
>> 
>> Paul.
>> 
>> On Mar 1, 2013, at 2:54 AM, Howard Lovatt <howard.lovatt at gmail.com> wrote:
>>> 
>>> Would it be useful in other cases if lambdas could implement abstract
>>> methods?
>>> 
>>> -- Howard.
>>> 
>> 
>> 



More information about the lambda-dev mailing list