From: "Stéphane Wirtel" Date: 2007-03-01T05:21:45+09:00 Subject: Overload [] operator and use a block ? Hi all, I would like to know if it's possible to overload the [] operator to use a block with it. example: class Test def []( x ) # to do something here yield if block_given? end end t = Test.new t['string'] do puts 'this is a test' end Thanks