jmichel / schur.institut.math.jussieu.fr (Jean Michel) writes:

>     write something like that
> 
>       sort { length($a) <=> length($b) or $a cmp $b }
> 
>     this does not work in ruby since 'or' behaves completely different --
>     it can apparently be used only in a very restricted way in boolean
>     expressions. The closest I could come with is:

try using nonzero? (if you've got the book, it's on 355)

>   - I was very surprised that  each_pair is not defined for arrays, only
>     hashes. Of course you can roll your own:

It's called each_with_index (defined in Enumerable)


>  Ok, now what did I miss, and  what is the rationale for no overloading,
> or the replacement for it that I missed?

I'll leave that one for Matz: there's a section in his book all about
coerce: perhaps he might be able to cut and paste it here.


Dave