I just recently realized why the default
iterator is called "each"... t.e., why
there is a default name at all.

As an exercise, I'm building a little set
module that will expand on the set manipulation
features that arrays have. (I'm not inheriting
from Array, though perhaps I should. I'll let
people critique it soon.)

I thought to myself, "Wouldn't it be nice if I
could do something like 'for x in s' as I can
for arrays?" Idly I tried it... and it worked!

For an instant I thought Ruby was reading my mind...
if Matz can do that, it IS a powerful language!

But then I realized that it was calling my 'each'
iterator that I had defined. And in order for this
kind of thing to be possible, the iterator has to
have a well-known name.

I love this language...

Hal

--
Hal Fulton


Sent via Deja.com http://www.deja.com/
Before you buy.