Hi and sorry if this has already been discussed. I''m new on theese lists, and I couldn''t find a way to search through them. I have been looking at the sources of script.aculo.us and I''m rather impressed by the Enumerable class. What I don''t get is why you choose to extend Array.prototype with this addon. It seems like a rather intrusive thing to do, if the code is ever going to play ball with other javascript components. It''s a half-baked solution anyway, since there are a lot of array-like elements in javascript, which doesn''t use the Array.prototype. You deal with this by using the $A() function. For all uses of Enumerable features, wouldn''t it be a better idea to have wrapper class which could decorate an array without actually adding to it''s prototype. Something along : (new Iterator(arguments)).find( function(value) { value > 44} ); This could even be shortened with a global shortcut to "new Iterator(...)", such as : $I(arguments).find( function(value) { value > 44} ); What you people are doing with prototype and scriptaculous is impressive, but I just have a nasty feeling about (what appears to me as) overuse of extending on built-in types. -- cheers, Troels
Hi and sorry if this has already been discussed. I''m new on theese lists, and I couldn''t find a way to search through them. I have been looking at the sources of script.aculo.us and I''m rather impressed by the Enumerable class. What I don''t get is why you choose to extend Array.prototype with this addon. It seems like a rather intrusive thing to do, if the code is ever going to play ball with other javascript components. It''s a half-baked solution anyway, since there are a lot of array-like elements in javascript, which doesn''t use the Array.prototype. You deal with this by using the $A() function. For all uses of Enumerable features, wouldn''t it be a better idea to have wrapper class which could decorate an array without actually adding to it''s prototype. Something along : (new Iterator(arguments)).find( function(value) { value > 44} ); This could even be shortened with a global shortcut to "new Iterator(...)", such as : $I(arguments).find( function(value) { value > 44} ); What you people are doing with prototype and scriptaculous is impressive, but I just have a nasty feeling about (what appears to me as) overuse of extending on built-in types. -- cheers, Troels
Hi and sorry if this has already been discussed. I''m new on theese lists, and I couldn''t find a way to search through them. I have been looking at the sources of script.aculo.us and I''m rather impressed by the Enumerable class. What I don''t get is why you choose to extend Array.prototype with this addon. It seems like a rather intrusive thing to do, if the code is ever going to play ball with other javascript components. It''s a half-baked solution anyway, since there are a lot of array-like elements in javascript, which doesn''t use the Array.prototype. You deal with this by using the $A() function. For all uses of Enumerable features, wouldn''t it be a better idea to have wrapper class which could decorate an array without actually adding to it''s prototype. Something along : (new Iterator(arguments)).find( function(value) { value > 44} ); This could even be shortened with a global shortcut to "new Iterator(...)", such as : $I(arguments).find( function(value) { value > 44} ); What you people are doing with prototype and scriptaculous is impressive, but I just have a nasty feeling about (what appears to me as) overuse of extending on built-in types. -- cheers, Troels PS. Pardon if this message ends up twice on the list - I''m having troubles sending to the list.
Hi and sorry if this has already been discussed. I''m new on theese lists, and I couldn''t find a way to search through them. I have been looking at the sources of script.aculo.us and I''m rather impressed by the Enumerable class. What I don''t get is why you choose to extend Array.prototype with this addon. It seems like a rather intrusive thing to do, if the code is ever going to play ball with other javascript components. It''s a half-baked solution anyway, since there are a lot of array-like elements in javascript, which doesn''t use the Array.prototype. You deal with this by using the $A() function. For all uses of Enumerable features, wouldn''t it be a better idea to have wrapper class which could decorate an array without actually adding to it''s prototype. Something along : (new Iterator(arguments)).find( function(value) { value > 44} ); This could even be shortened with a global shortcut to "new Iterator(...)", such as : $I(arguments).find( function(value) { value > 44} ); What you people are doing with prototype and scriptaculous is impressive, but I just have a nasty feeling about (what appears to me as) overuse of extending on built-in types. -- cheers, Troels
Ok, sorry, but this is the 5th time you''ve sent this. I understand you think you''re having problems sending it to the list or something, but really, you''re not. We got it. -----Original Message----- From: rails-spinoffs-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org [mailto:rails-spinoffs-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org] On Behalf Of troels knak-nielsen Sent: Tuesday, January 24, 2006 6:03 PM To: rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org Subject: [Rails-spinoffs] Enumerable Hi and sorry if this has already been discussed. I''m new on theese lists, and I couldn''t find a way to search through them. I have been looking at the sources of script.aculo.us and I''m rather impressed by the Enumerable class. What I don''t get is why you choose to extend Array.prototype with this addon. It seems like a rather intrusive thing to do, if the code is ever going to play ball with other javascript components. It''s a half-baked solution anyway, since there are a lot of array-like elements in javascript, which doesn''t use the Array.prototype. You deal with this by using the $A() function. For all uses of Enumerable features, wouldn''t it be a better idea to have wrapper class which could decorate an array without actually adding to it''s prototype. Something along : (new Iterator(arguments)).find( function(value) { value > 44} ); This could even be shortened with a global shortcut to "new Iterator(...)", such as : $I(arguments).find( function(value) { value > 44} ); What you people are doing with prototype and scriptaculous is impressive, but I just have a nasty feeling about (what appears to me as) overuse of extending on built-in types. -- cheers, Troels _______________________________________________ Rails-spinoffs mailing list Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs The information transmitted in this electronic mail is intended only for the person or entity to which it is addressed and may contain confidential, proprietary, and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from all computers.