Coin Considerations

Mark Mahieu markmahieu at
Sat Mar 14 08:05:25 PDT 2009

On 14 Mar 2009, at 14:25, Stephen Colebourne wrote:
> * For-each loop for Maps, based on
> for (String str, Integer val : map) {
> }
> * Iteration control in For-Each loops, based on
> for (String str : list : it) {
>    it.index();
>    it.hasNext();
>    it.remove();
> }

I wrote versions of these with BGGA - it is surprising how useful  
they can be.  I guess the Java 5 foreach covered 80% of cases, but  
the remaining 20% is still a very large number.

I do feel a bit uncomfortable with the idea of supporting these in  
the language itself though, FWLIW.

> I also thought List comprehensions might come up (not by me) -

I suspect that's another one which could be implemented very  
differently in a language with closures.

> See static implements. And yes, its a  
> great
> idea, but too complex for Coin.

Pity.  I don't know that it's really a good idea, but it would be an  
interesting one to put under the microscope.



More information about the coin-dev mailing list