Coin Considerations

Stephen Colebourne scolebourne at joda.org
Sat Mar 14 07:25:33 PDT 2009


Reinier Zwitserloot wrote:
> So what proposals are still fermenting in the minds of coin  
> contributors? Inspired by the recent discussion between Joe D'Arcy and  
> Mark Mahieu that people are possibly thinking someone else will be  
> proposing it.

* 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();
}


Abstract enums would be extremely useful, but are probably too big - 
http://freddy33.blogspot.com/search/label/abstract%20enum

I also thought List comprehensions might come up (not by me) - 
http://docs.google.com/View?docid=d4tx2hw_46fkz8x6gt


 > - factory interfaces (an interface to describe constructors and
 > static methods). I've got a simple way to do it, but I don't think
 > its simple enough for coin.

See https://kijaro.dev.java.net/ static implements. And yes, its a great 
idea, but too complex for Coin.

public class Foo implements static Iterable {
   public static Iterator iterator() {...}
}

Stephen



More information about the coin-dev mailing list