Bitten by the lambda parameter name

Maurizio Cimadamore maurizio.cimadamore at oracle.com
Mon Jul 15 08:13:24 PDT 2013


On 15/07/13 15:52, Remi Forax wrote:
> This snippet not compile,
>     Kind kind = ...
>     partySetMap.computeIfAbsent(kind, kind -> new HashSet<>()).add(party);
>
> Each time I write more than a hundred lines of codes that use some lambdas,
> I fall into this trap.
>
> It's very annoying !
>
> Rémi
>
>
Annoying yes - but there is a reason for it? If we provide special 
scoping for lambda parameters then we will never be able to add control 
abstraction syntax in a nice way; not saying that it's something we want 
- but it's good to have option open at least.

Maurizio


More information about the lambda-dev mailing list