[Rails-spinoffs] Prototype Enumerable (was: "Stateless" effects)

Michael Schuerig
Tue, 06 Sep 2005 09:02:26 -0000

On Tuesday 06 September 2005 15:07, Thomas Fuchs wrote:
> > BTW: Is there any documentation about the iterator stuff in
> > prototype? I am also interested about the performance. For
> > time-critical code like the checks for drag&drop, the overhead
> > might be to much.
>
> True. If you let a unit test pass for "documentation", there is
one
> at: http://dev.conio.net/repos/prototype/test/unit/enumerable.html

I only noticed the addition thanks to Martin''s message. K combinator,
anyone? Two thinks I noticed.

For non-native speakers Enumerable.pluck is hardly understandable
without looking at the code. How about Enumerable.project (as an
alias)? It''s still not intuitive, but may be understood by more people.

The comparisons for _break and _continue are done using the equality
operator (==). Wouldn''t the identity operator (===) be more suitable?

Looking at the code I got the impression that Sam is out to prove that
it''s possible to write Ruby code in JavaScript :-)

Michael

--
Michael Schuerig                 Not only does lightning not strike
mailto:michael@schuerig.de       twice, it usually doesn''t strike once.
http://www.schuerig.de/michael/  --Salman Rushdie, Fury