From: Albert Schlef Date: 2009-12-31T14:24:12+09:00 Subject: Re: Why can't I use "or" here? Gary Wright wrote: > On Dec 30, 2009, at 9:24 PM, Albert Schlef wrote: > >> puts(nil or 4) >> >> fails... it is a syntax error, for some mysterious reason. > > Try: > > puts((nil or 4)) > > I found a discussion of this in: > http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/38272 Thanks. So it seems Ruby internally recognizes some structures as "statemenets" and others as "expressions". It seems disapointing at first, but since Ruby supports precedence for operators (something Lisp doesn't), there has to be some price to pay. -- Posted via http://www.ruby-forum.com/.