From: ts Date: 2002-08-22T01:20:43+09:00 Subject: Re: parametric sort >>>>> "K" == Kontra, Gergely writes: K> userChoice='size' K> myArray.sort(sortMethods[userChoice]) Something like this ? pigeon% cat b.rb #!/usr/bin/ruby SM = { 'name' => proc {|a, b| a <=> b}, 'size' => proc {|a, b| b <=> a} } p [1, 3, 2].sort &SM['name'] p [1, 3, 2].sort &SM['size'] pigeon% pigeon% b.rb [1, 2, 3] [3, 2, 1] pigeon% Guy Decoux