Fwd: [dojo-contributors] [feedback wanted] Preferred Iteration forms
ttrenka at gmail.com
Mon Apr 3 20:28:18 EDT 2006
The ideal would be to not use it at all, which is basically what I've
arguing with you guys about. I've no problem creating the dependency with
the search trees and graph; both of the those are much more complex than the
Jeez, all I wanted to know was which style of imperative iterator we
On 4/3/06, Bill Keese <bill at dojotoolkit.org> wrote:
> You and I are both concerned with the size of dojo's footprint. But,
> common libraries like dojo.lang exist to prevent code duplication and
> thus to decrease the size of the footprint.
> If you duplicate the code in dojo.lang, most people will end up pulling
> in both dojo.lang and your duplicated code. I know you want to avoid
> pulling in array.js, but I really don't think that will ever be possible
> with dojo, at least not for most applications.
> Also, if you duplicate the forEach() function, then you duplicate
> possible bugs in that function.
> Tom Trenka wrote:
> > I think the issue is non-array based collections, such as graphs and
> > trees. Coercing those objects into arrays (copying all of the data)
> > inefficient. Both calling dojo.lang.forEach() and imperative
> > require copying all the data to an array. Thus writing your own
> > forEach() is better. (On the other hand, performance can always be
> > 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
> > lang/array.js. forEach() is referenced 38 times in the code, even
> > event.js.
> > 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
> > ------------------------------------------------------------------------
> > _______________________________________________
> > dojo-contributors mailing list
> > dojo-contributors at dojotoolkit.org
> > http://dojotoolkit.org/mailman/listinfo/dojo-contributors
> dojo-contributors mailing list
> dojo-contributors at dojotoolkit.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the dojo-contributors