From: Good Night Moon Date: 2007-07-23T05:30:02+09:00 Subject: Parsing bug with 'return not' (was, Syntax bug) On Sun, 22 Jul 2007 03:50:01 -0400, Bil Kleb wrote: >> myrect.rb:8: syntax error, unexpected kNOT, expecting kEND >> return not ((other.x1 < self.x0 or self.x1 < other.x0) and > > You need to use the '!' operator instead of the 'not' "conjunction". > It's a precedence thing -- the parser is seeing 'return not' -- see > parse.y in the source. Thanks, maybe I'll look. It's not just precedence though, or else 'return' itself is part of it: def ok return (not true) end def fails return not true end And note that within an 'if', it works as you'd expect: def with_parens_ok if (not true) puts "not true" end end def no_parens_ok if not true puts "not true" end end