Coin Considerations

Mark Mahieu markmahieu at googlemail.com
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
> http://www.jroller.com/scolebourne/entry/java_7_for_each_loops
>
> for (String str, Integer val : map) {
> }
>
> * Iteration control in For-Each loops, based on
> http://www.jroller.com/scolebourne/entry/java_7_for_each_loop
>
> 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) -
> http://docs.google.com/View?docid=d4tx2hw_46fkz8x6gt

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

> See https://kijaro.dev.java.net/ 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.

Regards,

Mark




More information about the coin-dev mailing list