Exceptions and lambda.
forax at univ-mlv.fr
Wed Feb 20 07:15:45 PST 2013
On 02/06/2013 02:57 PM, Srikanth S Adayapalam wrote:
> > From: Maurizio Cimadamore <maurizio.cimadamore at oracle.com>
> > Subject: Re: Exceptions and lambda.
> > It would seem that the text is implying that the restriction comes
> > from the fact that a lambda has no syntax for declaring type-
> > parameters. On the other hand I'm not sure that's enough, as the
> > compiler could simply generate a signature that matches the one in
> > the functional descriptor so that overriding is preserved (esp. when
> > lambda formals are omitted).
> As a matter of fact, I had (incorrectly) assumed that the primary reason
> we support elided types was to accommodate this scenario, where due to
> lack of own type variables, the lambda won't be able to spell out a
> signature that is equivalent and only secondarily to minimize noise in
> complex expressions/invocations etc.
No, the main reason is more practical, if you doesn't allow to elide types,
you end up with lambda where the parameter declaration part is far bigger
than the expression part.
This goes back to the lambda/closure syntax war in 2009, it was part of
the CICE proposal.
> > I said
> > mostly because if the descriptor doesn't mention type-variables in
> > the argument part, then the check doesn't help and we're back to
> square one.
> Then don't we just have concrete types that could be type checked against
> each other ?
More information about the lambda-spec-experts