hg: lambda/lambda/langtools: Improved support for lambda conversion.

Neal Gafter neal at gafter.com
Mon Jun 21 08:52:40 PDT 2010


On Mon, Jun 21, 2010 at 8:31 AM, Maurizio Cimadamore
<maurizio.cimadamore at oracle.com> wrote:
> Hi Neal
> we are still working out the details; see comments inline:
>
> On 21/06/10 15:11, Neal Gafter wrote:
>>
>> Maurizio-
>>
>> What are the rules about checked exceptions thrown by the constructor?
>
> It would seem sensible to enforce clients to catch those exceptions

Yes, but where?  The draft specification says that it wants to leave
it unspecified where the conversion occurs.

>> What accessibility rules are enforced for the constructor?
>
> I'd say that public/protected no-arg constructor would be fine

Not package private?

>> How are the constructor's type parameters inferred?
>
> I'd say that, given the strawman spec doesn't allow SAM types defining
> generic methods, a similar ban should apply to SAM types defining a generic
> no-arg constructor.

I don't see how these are analogous.

>> Is there any way to access the SAM class from within the lambda?
>>
>
> No. And I think there shouldn't be any. If we did that we would split the
> set of lambda expressions in two subets, lambda that can be used only within
> a lambda conversion, and all other lambdas.

That's sensible, but that removes the last remaining reason to have
"this" defined to refer to the lambda itself rather than taking its
meaning from the enclosing scope.

Cheers,
Neal


More information about the lambda-dev mailing list