From: Peter Ertl Date: 2005-10-20T02:53:02+09:00 Subject: Re: this works fine for me: b x.sort_by { |v| if v ; 1 else 0 end } > --- Urspr�ngliche Nachricht --- > Von: Xeno Campanoli > 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 >