From: Gary Wright Date: 2009-12-31T12:33:04+09:00 Subject: Re: Why can't I use "or" here? On Dec 30, 2009, at 9:24 PM, Albert Schlef wrote: > (The problem is in both Ruby 1.8 and Ruby 1.9) > > The expression: > > puts(nil || 4) > > works as expected. It prints '4'. > > But this expression: > > puts(nil or 4) > > fails... it is a syntax error, for some mysterious reason. > > Why? I thought the only diference between "or" and "||" is the > precedence. 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