Thanks for writing about this. I think it's an interesting idea, but is almost certainly infeasible because we need to abide by an existing API.
JavaScript 1.6 (Firefox >= 1.x) introduced some functional array methods, including one called "map" which does the exact same thing as our Enumerable#map. [1] These array methods take a function as the first argument and a scope as the second argument. Since we redefine the native Array#map, we can't make any changes that would break scripts that rely on the way the original Array#map works. We could rewrite the Enumerable methods to accept these arguments in either order, but I don't think we'd gain much from doing so. Also, as Ryan points out, optional arguments should always occur to the right of required arguments. Cheers, Andrew [1] http://developer.mozilla.org/en/docs/New_in_JavaScript_1.6 On Feb 7, 10:11 pm, sambo99 <[EMAIL PROTECTED]> wrote: > I blogged about this issue here: > > http://www.samsaffron.com/archive/2008/02/09/A+cleaner+way+to+iterate... > > I think iterators look nicer when you have the scope as the first > param. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Prototype: Core" group. To post to this group, send email to prototype-core@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/prototype-core?hl=en -~----------~----~----~----~------~----~------~--~---