From: "David A. Black" Date: 2009-01-11T09:41:43+09:00 Subject: Re: What is meant by << operator ??? Hi -- On Sun, 11 Jan 2009, Tim Greer wrote: > FrihD 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 > wording, though. 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: a.<<(b) 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 -- 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!