From: Michael Neumann Date: 2001-04-30T18:08:32+09:00 Subject: [ruby-talk:14433] Re: || .. or Question Pixel wrote: > about surprising precedence: > > Math.sqrt (1-2).abs is (Math.sqrt(1-2)).abs > p (1..10).to_a is (p(1..10)).to_a > > > but > > return (1-2).abs is return((1-2).abs) > > which show that "return" is parsed differently even if it has a functional > syntax just like "Math.sqrt". "return" has a lower precedence Return is a keyword in Ruby not a method call. It's parsing behavior is hard-coded in the parser. (return (1-2)).abs gives me a compile error, because "return" is not an expression but an statement (or "void value expression") which value is "void" (not nil!). The same is with "while". The usage of "return" inside an expression does not make sense for me. Also that of "while" is not that useful, I think. Regards Michael -- Michael Neumann merlin.zwo InfoDesign GmbH http://www.merlin-zwo.de