From: Michael McDaniel Date: 2002-04-13T13:38:58+09:00 Subject: RE: not vs !, and vs && james@rubyxml.com wrote: >> >> > puts true and (! true) # prints true >> > puts true && (! true) # prints false >> >> very simple. the and has a very low precedence. there are just 3 levels, >> iirc, and this is the lowest one. >> so, the first one is equal to >> >> puts(true) && (! true) >> >> while the second one would be >> >> puts(true && (! true)) > > Ah so. Thank you. I'm still unclear about > puts( !true ) > and > puts( not true ) > > The latter gives a parse/syntax error on Win2K, for 1.6.5 and 1.7.2 (my > msvc build), and 1.6.7 and 1.7.2 on redhat 6.something. Is this a known > bug? ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ irb(main):127:0* `ruby --version` "ruby 1.7.2 (2002-02-22) [i686-linux]\n" irb(main):128:0> puts ( ! true ) false nil irb(main):129:0> puts ( not true ) false nil irb(main):130:0> on SuSE release 7.3 ~mm > > On a related note, are there times when the boolean methods of TrueClass > and FalseClass are prefereably to the general boolean operators? > > > > Thanks, > > > James > >> >> regards, >> >> nick >>