On 05.01.2009 23:21, Brian Candler wrote: > Robert Klemme wrote: >> Brian, you are contradicting yourself: first you deny the presence of >> operators in Ruby and then you talk about them nevertheless. :-) >> >> Fact is, there _are_ operators in Ruby - and they do have a precedence. >> (I am not sure why you put an "only" into the sentence above - >> operator precedence is what a precedence table is about.) > > Operators in Ruby are nothing more than syntactic sugar for method > calls. Well, in a way that's what they are in every procedural language - they are just a special notation for a method / function invocation, aren't they? Even if technically a compiler does not generate a subroutine call, they represent the code inserted there which is always the same for the same types of arguments. What makes operators special in some procedural languages is that they are overloaded (plus for int, plus for float etc.) while functions cannot be overloaded in those languages. And, of course, they need a defined precedence because of the different syntax (i.e. their arguments are not grouped via brackets as for function / method calls). > The "only" was because the OP wanted the table to include the "meaning" > of each operator. I am agreeing with you that an operator precedence > table should show only operator precedence :-) :-) Ah, I see. In case of Ruby the meaning cannot be included anyway because operators are overloaded and can be overloaded by the user - so there is no fixed meaning. Kind regards robert -- remember.guy do |as, often| as.you_can - without end