From: Brian Candler Date: 2010-09-01T18:16:41+09:00 Subject: [ruby-core:31992] Parsing of 'not' Is the following intentional? >> puts(not 3 < 4) SyntaxError: compile error (irb):4: syntax error, unexpected kNOT, expecting ')' puts(not 3 < 4) ^ (irb):4: syntax error, unexpected ')', expecting $end from (irb):4 from :0 However, it works with double parentheses: >> puts((not 3 < 4)) false Tested with: ruby 1.8.7 (2010-01-10 patchlevel 249) [x86_64-linux] I stumbled across this when trying to do: assert not a < b Regards, Brian. P.S. In any case it seems to be difficult to use the value of 'not', unless you add parentheses. >> not 3 < 4 => false >> a = not 3 < 4 SyntaxError: compile error (irb):2: syntax error, unexpected kNOT a = not 3 < 4 ^ from (irb):2 from :0 >> a = (not 3 < 4) => false I realise that 'and' and 'or' have precedence lower than assignment, but 'not' is a unary operator. Perl has no problem with the following: perl -e 'print not 4 < 3' # prints 1 perl -e '$a = not 4 < 3; print $a' # prints 1