From: Ryan Davis Date: 2010-09-08T13:37:55+09:00 Subject: Re: defining self-reflexive operators in Ruby On Sep 7, 2010, at 18:16 , Harry Spier wrote: > > In the same way that a += 1 means a = a+1 > is it possible in Ruby to create an operator such as .! (or something > like that) such that > someObject.!someMethod gives the same result as > someObject = someObject.someMethod no. someObject isn't the object, it is just a local variable reference to it. Objects don't know what variables or other objects refer to them. Ruby's syntax is opaque, so it wouldn't be possible to write something (in ruby, which is what you asked for) that could operate at parse-time in this way (without fully pre-parsing, munging, and re-eval'ing. At that stage, I wouldn't call it "in ruby").