On Mon, Apr 13, 2009 at 00:32, Greg Brown <[email protected]> wrote:
> Honestly, we've been working with this API as-is for quite a while, and I've 
> never found it to be a significant inconvenience. In fact, I rather like the 
> elegance of code like the following:
>
> for (int i = 0, n = mySequence.getLength(); i < n; i++) {
>   ...
> }
>

I guess I'm going to have to disagree with you there - I find that
very clunky :-)

But my point is that with the introduction of Iterable into the java
libraries, programmer __expect__ to be able to iterate over list-like
things.

And the use of Sequence in the wtk API violates that assumption (ref.
Principle of Least Surprise)

I don't see that adding a new type IterableSequence and making it the
default in the wtk API would add any extra overhead - you could keep
doing your style for-loops, and I could have mine :-)

Regards, Noel Grandin

Reply via email to