PROPOSAL: Enhanced for each loop iteration control (original) (raw)
Stephen Colebourne scolebourne at joda.org
Mon Mar 30 16:51:43 PDT 2009
- Previous message: PROPOSAL: Enhanced for each loop iteration control
- Next message: Anyone ever considered named tuples?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Marek KozieĊ wrote:
So from your proposal I would remove Interface-s and link iterator through label, label type is return type of .iterator() method.
String[] array ...; i: for (String s:array){ i.getIndex;//? }
While I understand that this may seem appealing, it really isn't. Labels are in a different namespace IIRC, and using that for psuedo method calls is really an abuse.
I accept that my proposal doesn't allow custom iterators, but I don't believe that to be a major problem. Consider it that my proposal tackles 80%+ of the problem (which was part of the 20% of the original looping problem, and still a good number of LOC in a reasonable system).
Stephen
- Previous message: PROPOSAL: Enhanced for each loop iteration control
- Next message: Anyone ever considered named tuples?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]