From: George Ogata Date: 2006-01-02T16:22:56+09:00 Subject: Re: Can't change the value of self Wilson Bilkovich writes: > 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. > You could do s.<<('a', 'b'), but it seems unrubyish. Perhaps you could settle for: s << ['a', 'b'] > Is that another of those YACC limitations? Hmmm, I don't know if it's a limitation, but it could get confusing. Consider: four, three = 1 << 2, 3 arr = [x << 1, x << 2] And if you do it for `<<', then what about `+', `-', `%'? If you do do it for those, then you start to lose really basic stuff like: arr = [a + 1, b + 1] b, a = a % b, b until b == 0