Submitted by Oliver (not verified) on Sat, 08/04/2007 - 18:50.
Scott: I agree completely about [1,2,3,4].map(‘x*x’) versus map(‘x*x’, [1,2,3,4]): I find the first more readable too. I didn't add these to Functional first because extending Array.prototype breaks associative array iteration. (See these postings by "Erik Arvidsson":http://erik.eae.net/archives/2005/06/06/22.13.54/, "James Mc Parlane":http://blog.metawrap.com/blog/WhyIDontUseThePrototypejsJavaScriptLibrary.aspx, and "davber":http://blog.davber.com/2006/08/24/prototype-arrays-improving-upon-ajax/). And second, because several of the DOM frameworks come with their own collection methods, and I didn't want to duplicate their work.
So, although I prefer [1,2,3,4].map(‘x*x’) myself and I'm willing to give up associative array iteration to get it, I didn't want to compile that tradeoff into this library.
Dean, thanks for the kind words --- I've enjoyed reading your code too. :-) I'll incorporate your improvement into the next version of the library.
Oliver Steele lives in Western Massachusetts and commutes to downtown LA, where he is bringing an operating system from handwaving to reality. He was the architect of OpenLaszlo, the author of PyWordNet and other open source projects. His interests include programming languages, knowledge representation, information visualization, and math education. [more]
Scott: I agree completely about [1,2,3,4].map(‘x*x’) versus map(‘x*x’, [1,2,3,4]): I find the first more readable too. I didn't add these to Functional first because extending Array.prototype breaks associative array iteration. (See these postings by "Erik Arvidsson":http://erik.eae.net/archives/2005/06/06/22.13.54/, "James Mc Parlane":http://blog.metawrap.com/blog/WhyIDontUseThePrototypejsJavaScriptLibrary.aspx, and "davber":http://blog.davber.com/2006/08/24/prototype-arrays-improving-upon-ajax/). And second, because several of the DOM frameworks come with their own collection methods, and I didn't want to duplicate their work.
So, although I prefer [1,2,3,4].map(‘x*x’) myself and I'm willing to give up associative array iteration to get it, I didn't want to compile that tradeoff into this library.
Dean, thanks for the kind words --- I've enjoyed reading your code too. :-) I'll incorporate your improvement into the next version of the library.