PROPOSAL: Enhanced for each loop iteration control

Marek Kozieł develop4lasu at gmail.com
Tue Mar 31 06:49:05 PDT 2009


2009/3/31 Stephen Colebourne <scolebourne at joda.org>:
> 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.

2009/3/31 Reinier Zwitserloot <reinier at zwitserloot.com>:
[snip]
>
>
> NB: Yes, labels are an entirely separate namespace.
>
>  --Reinier Zwitserloot
>

I didn't noticed that ;P
Thanks!

2009/3/31 Stephen Colebourne <scolebourne at joda.org>:
>
> I accept that my proposal doesn't allow custom iterators, but I don't
> believe that to be a major problem.

In my opinion it is.
Interfaces and needs evolve.

Enumeration -> Iterator -> ArrayIterationControlIterator,
IterableIterationControlIterator -> ???

So there is no point to limit language here, and change Iterator type
every 4 Java versions, while obtain actual iterator type is no
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
>

If iterator cannot be assigned to variable and .next() cannot be
called (compile time error) then this proposal can be really nice one.

-- 
Pozdrowionka. / Regards.
Lasu aka Marek Kozieł

http://lasu2string.blogspot.com/



More information about the coin-dev mailing list