On Sun, 11 Jan 2009, Tim G. wrote:
It is not an operator, but actually is the method “<<”. So it depends
on the object that receives this method.
Actually, it depends on what it depends on, because it’s both (either
or). It’s a method, or just an operator (<< left shift bitwise
operator), or as an append operator. I suppose it’s all in the use and
The method-ness has a certain primacy, in the sense that this:
a << b
is always a method call; that is, it is always the same as:
The syntactic sugar, however, has the clear purpose of making it look
like an infix operator. I think it’s an operator kind of the way
“attributes” are attributes – that is, mainly in the eye of the
beholder. The language really doesn’t care whether we call things
attributes and operators, so it’s all about what helps people make
sense of it.
David A. Black / Ruby Power and Light, LLC
Ruby/Rails consulting & training: http://www.rubypal.com
Coming in 2009: The Well-Grounded Rubyist (http://manning.com/black2)
http://www.wishsight.com => Independent, social wishlist management!