(unknown)

#!/usr/bin/ruby

···

#
# try003.rb
#
# Here is my bug. It turns out it's not as whacky as I though. It just
# was failing because Ruby cannot sort booleans; presumably an omission:

b = [false,true,false,true]

b.sort.each do |bool|
  p bool
end

this works fine for me:

b x.sort_by { |v| if v ; 1 else 0 end }

···

--- Ursprüngliche Nachricht ---
Von: Xeno Campanoli <xeno@eskimo.com>
An: ruby-talk@ruby-lang.org (ruby-talk ML)
Betreff: -no subject-
Datum: Thu, 20 Oct 2005 02:39:11 +0900

#!/usr/bin/ruby
#
# try003.rb
#
# Here is my bug. It turns out it's not as whacky as I though. It just
# was failing because Ruby cannot sort booleans; presumably an omission:

b = [false,true,false,true]

b.sort.each do |bool|
  p bool
end