Fwd: [dojo-contributors] [feedback wanted] Preferred Iteration forms
ttrenka at gmail.com
Mon Apr 3 18:44:24 EDT 2006
> I think the issue is non-array based collections, such as graphs and
> trees. Coercing those objects into arrays (copying all of the data) is
> inefficient. Both calling dojo.lang.forEach() and imperative iterators
> require copying all the data to an array. Thus writing your own
> forEach() is better. (On the other hand, performance can always be done
> later... but it's good to decide the API early)
That's fine. I have no problem with a custom iterator on those types of
complex collections; that makes plenty of sense. I just don't want to throw
out what is probably the most common type of iterator for the sake of doing
a functional one, and I don't want to force a dependency if I don't have to.
It's hard to believe that many people are using dojo without including
> lang/array.js. forEach() is referenced 38 times in the code, even from
That's no reason to assume it's presence; that kind of thinking (no offense)
is the reason why the Animation code has 13 or so dependencies now.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the dojo-contributors