From: Mark Sparshatt Date: 2004-05-01T03:12:30+09:00 Subject: Re: def [](v) xx; return yy; end # returned value is ignored !? Mark Hubbart wrote: > > On Apr 30, 2004, at 9:12 AM, Jean-Hugues ROBERT wrote: > >> Am I missing something ? > > > Short answer: assignment always returns the value assigned, regardless > of the return value of the function assigned to. > > If you REALLY need to get around this, try: > > Test.new.send(:[]=, "hello") Actually there's an easier way, you can just use Test.new.[]= "hello" > > This eliminates the actual assignment, and treats it as a simple > method call. The return value is respected. > > HTH, > --Mark > >