On 1/1/06, Hal Fulton <hal9000 / hypermetrics.com> wrote: > James Britt wrote: > > Jonathan Leighton wrote: > > > >> Can't change the value of self (SyntaxError) > >> self = round_to *args > >> > >> Why doesn't it work? What can I do instead? > > > > > > "Destructive" methods must alter self using that self's existing > > destructive methods. > > To which we should add: Time has no destructive methods, since > Time objects are immutable. > > But someone once created a MutableTime class -- anyone recall > who/when/where and whether it's complete? > This is why I can't do: class Fixnum def double! self *= 2 end end ..right? Too bad. Speaking of methods.. is there a way to do: class Something def <<(a, b) # do something with a and b end end s = Something.new s << 'a', 'b' results in a syntax error. Is that another of those YACC limitations?