From: ts Date: 2000-12-24T19:24:45+09:00 Subject: [ruby-talk:8030] Re: Basic hash question >>>>> "B" == Ben Tilly writes: B> class Foo < String B> def foo= (foo) B> @foo = foo B> end B> def foo B> @foo B> end B> end class Foo < String attr_accessor :foo end is faster to write and faster to execute B> puts h[a] puts h[a.to_s] B> puts a.foo B> So how does this work? How does Ruby determine the thing B> hash? (In Perl it is really simple, everything is B> converted to a string and then the strings are hashed.) an hash as a lookup table Guy Decoux