Primitives in Generics (+ the meaning of this)
Rémi Forax
forax at univ-mlv.fr
Fri Jul 16 10:54:56 PDT 2010
Le 16/07/2010 19:25, Neal Gafter a écrit :
> On Fri, Jul 16, 2010 at 10:07 AM, Brian Goetz<brian.goetz at oracle.com>wrote:
>
>
>> And, given that inner classes *already* suffer from the accidental
>> shadowing
>> problem, creating a mechanism that goes the other way (even if the other
>> way
>> is absolutely right!) is even more confusing for Java developers, who now
>> have
>> to keep track of two separate and inconsistent bits of puzzlerhood.
>>
>>
> Brian-
>
> I don't believe it would be more confusing for Java developers (except those
> completely unfamiliar with the new language feature). But setting that
> aside, this leads to the natural question: If we're wanting to recreate all
> the problems of anonymous inner classes, what, if any, problems ARE
> addressed by project lambda, and what is newly possible that was not
> possible previously?
>
> -Neal
>
Good question. and I haven't no good answer.
Runnable r = { -> foo(this); }
Callable<?> c = { -> foo(this); }
what is the signature of foo in those cases ?
BTW, there is at least something that inner-class does and lambda doesn't.
You can send argument to the constructor of an inner-class
and you can't do that with lambda.
Rémi
More information about the lambda-dev
mailing list