From: ts Date: 2001-05-28T01:00:56+09:00 Subject: [ruby-talk:15806] Re: is it possible to dynamically coerce objects types in Ruby? >>>>> "M" == Mirian Crzig Lennox writes: M> myObj = MyClass.new(...) M> elem = anArray[myObj] use #to_int pigeon% cat b.rb #!/usr/bin/ruby class MyClass def to_int 1 end end array = [1, 2] p array[MyClass.new] pigeon% pigeon% b.rb 2 pigeon% Guy Decoux