From: Bill Kelly Date: 2009-11-08T17:43:55+09:00 Subject: [ruby-core:26620] Re: HashWithIndifferentAccess to core From: "Run Paint Run Run" > > FTR, the idiom is also employed by core APIs such as ENV and MatchData: > >>> ENV['TERM'] > => "xterm" >>> ENV[:TERM] > => "xterm" >>> match = 'Finding a needle in a haystack'.match(/(?ne.+?e)/) > => # >>> match['needle'] > => "needle" >>> match[:needle] > => "needle" That reminds me of where I first experienced this idiom. :) irb(main):001:0> class Foo ; def kazango!; p 'KAZANGO!' ; end ; end => nil irb(main):002:0> x = Foo.new => # irb(main):003:0> x.send "kazango!" "KAZANGO!" irb(main):004:0> x.send :kazango! "KAZANGO!" Regards, Bill