From: Dave Thomas Date: 2002-02-25T01:17:34+09:00 Subject: Re: duplicate method name Grumpy Ron Jeffries writes: > I must be missing something, because I don't get it. What could .meth > possibly be other than a method call? What could the stuff in parens > possibly be other than the parameters? It could be the start of an expression... def a(arg) arg+7 end a (1+2) * 3 =>? When Ruby 1.6 warns: a (...) interpreted as method call, it's saying: Hmm.. Look at this. I could interpret what Ron wrote as call 'a' passing in (1+2). Return 10, then multiply the result by 3 or, I could interpret it as evaluate (1+2)*3 as an expression, and pass the result as an argument to the method 'a'. Decisions, decisions. I know, I'll interpret the construct a (...) as a method call (with arguments), and return the result. And that's what it does. "a (...) interpreted as method call" means that the arguments (...) were passed to the method 'a'. It _could_ be clearer, but it does make sense and there _is_ ambiguity here in the general case. Then, in 1.7, the interpretation of this changes: now the whole expression is taken as a parameter to the method. That's why the warning changed: the (1+2)*3 is taken to be a grouped expression. In general, it's best not to put a space between a method name and its parameters. And the incompatibility between 1.6 and 1.7 is a damn fine reason to run with -w all the time. Cheers Dave