Exceptions and lambda.
Srikanth S Adayapalam
srikanth_sankaran at in.ibm.com
Wed Feb 6 05:50:07 PST 2013
I understand the parsing complexities around introducing type variables ("
generic lambdas involves invasive,
messy changes to the grammar. ") in lambda expressions. It is also
reasonable to stipulate that a lambda expression
cannot refer to type variables from the descriptor by name - that would be
too fragile and unreadable.
But where the formal parameter types are elided and derived from the
descriptor, it would seem it makes sense to
allow a lambda expression to implement the interface method if the
implementation has no need to refer to
the type variables. It gets passed certain objects that are guaranteed to
have satisfied the constrains and it can
do what it wants with it.
Banning it outright seems way more restrictive than saying you can't
introduce type variables and you can't
"inherit" type variables - Perhaps I am missing some nuances here.
Personally speaking, I am still on 1.4 and don't expect to use lambda
expressions in the next decade or so :-)
I have no problem banning lambdas when the descriptor is generic - I just
did that in the eclipse compiler :)
Srikanth
Maurizio Cimadamore <maurizio.cimadamore at oracle.com> wrote on 02/06/2013
08:03:05 AM:
> From: Maurizio Cimadamore <maurizio.cimadamore at oracle.com>
> To: Srikanth S Adayapalam/India/IBM at IBMIN,
> Cc: Dan Smith <daniel.smith at oracle.com>, lambda-spec-
> experts at openjdk.java.net, lambda-spec-experts-
> bounces at openjdk.java.net, lambda-spec-observers at openjdk.java.net
> Date: 02/06/2013 08:02 AM
> Subject: Re: Exceptions and lambda.
>
> On 06/02/13 12:51, Srikanth S Adayapalam wrote:
> I couldn't find some text that explicitly
> forbids the scenario we are talking about (where types are elided
> and inferred and
> there is no further need to refer to any type variables)
> I think I cannot find it either - I think it should be in 15.27.3
> Type of a Lambda Expression' - Dan?
>
> Maurizio
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.openjdk.java.net/pipermail/lambda-spec-experts/attachments/20130206/7a0bc7e7/attachment.html
More information about the lambda-spec-experts
mailing list