Re: enhanced for loop with multiple iteration variables

2019-01-02 Thread Alan Snyder
e: "Alan Snyder" >> À: "Brian Goetz" >> Cc: "core-libs-dev" >> Envoyé: Vendredi 21 Décembre 2018 03:19:14 >> Objet: Re: enhanced for loop with multiple iteration variables > >> RIght, but I don’t see that as a general solution.

Re: enhanced for loop with multiple iteration variables

2019-01-01 Thread Remi Forax
- Mail original - > De: "Alan Snyder" > À: "Brian Goetz" > Cc: "core-libs-dev" > Envoyé: Vendredi 21 Décembre 2018 03:19:14 > Objet: Re: enhanced for loop with multiple iteration variables > RIght, but I don’t see that as a general soluti

Re: enhanced for loop with multiple iteration variables

2018-12-23 Thread forax
- Mail original - > De: "Alan Snyder" > À: "Remi Forax" > Cc: "core-libs-dev" > Envoyé: Vendredi 21 Décembre 2018 03:20:46 > Objet: Re: enhanced for loop with multiple iteration variables > Lambdas are clean, but limited in current Java c

Re: enhanced for loop with multiple iteration variables

2018-12-20 Thread Alan Snyder
. > }); > > Rémi > > - Mail original - >> De: "Brian Goetz" >> À: "Alan Snyder" , "core-libs-dev" >> >> Envoyé: Jeudi 20 Décembre 2018 23:50:15 >> Objet: Re: enhanced for loop with multiple iteration variables >

Re: enhanced for loop with multiple iteration variables

2018-12-20 Thread Alan Snyder
RIght, but I don’t see that as a general solution. Its also a bit kludgy, like saying that methods need only one parameter because you can always pass a data object. > On Dec 20, 2018, at 2:50 PM, Brian Goetz wrote: > > For Map, you can do: > > for (Map.Entry e : map.entrySet()) { ... } >

Re: enhanced for loop with multiple iteration variables

2018-12-20 Thread Remi Forax
or map.forEach((key, value) -> { ... }); Rémi - Mail original - > De: "Brian Goetz" > À: "Alan Snyder" , "core-libs-dev" > > Envoyé: Jeudi 20 Décembre 2018 23:50:15 > Objet: Re: enhanced for loop with multiple iteration variables

Re: enhanced for loop with multiple iteration variables

2018-12-20 Thread Brian Goetz
For Map, you can do:     for (Map.Entry e : map.entrySet()) { ... } and you're already there. On 12/19/2018 9:54 AM, Alan Snyder wrote: Has any consideration been given to supporting iterators that provide more than one iteration variable in the enhanced for loop? Obvious uses would be map

enhanced for loop with multiple iteration variables

2018-12-19 Thread Alan Snyder
Has any consideration been given to supporting iterators that provide more than one iteration variable in the enhanced for loop? Obvious uses would be maps (keys and values) and lists (indexes and values). I have in mind keeping the syntactic sugar approach by using one or more extensions of th