On Thu, 20 May 2004 09:47:07 +0900, Nicholas Van Weerdenburg
<nick / activehitconsulting.com> wrote:
> 
> nonzero? returned nil instead of false for me. Shouldn't it return false?
> 
> 

8< ----- snip -----

No. From the pickaxe:

nonzero?  num.nonzero? -> num or nil  

Returns num if num is not zero, nil otherwise. This behavior is useful
when chaining comparisons:

a = %w( z Bb bB bb BB a aA Aa AA A )  
b = a.sort {|a,b| (a.downcase <=> b.downcase).nonzero? || a <=> b }  
b  ? ["A", "a", "AA", "Aa", "aA", "BB", "Bb", "bB", "bb", "z"]  

Cheers...
  -C