From: "David A. Black" Date: 2010-01-01T20:15:03+09:00 Subject: Re: Why can't I use "or" here? Hi -- On Thu, 31 Dec 2009, Phillip Gawlowski wrote: > On 31.12.2009 06:32, Albert Schlef wrote: > >> It works. But, I must say, it isn't as beautiful as my original plan. It >> doesn't read as English. > > PS C:\Scripts> ruby .\unless.rb > ./unless.rb:1: Argument error (RuntimeError) > PS C:\Scripts> ruby .\unless.rb "arg" > PS C:\Scripts> cat .\unless.rb > raise "Argument error" unless ARGV[0] > PS C:\Scripts> > > I prefer it that way. :) > > Works in 1.8.6 and 1.9.1, too, to my great relief. It even works in 1.0: $ ruby10 -ve 'raise "Argument error" unless ARGV[0]' ruby - version 1.0-971225 (i686-linux) -e:1: RuntimeError: Argument error I wouldn't worry about that idiom ceasing to work :-) David -- David A. Black Senior Developer, Cyrus Innovation Inc. THE COMPLEAT RUBYIST, Ruby training with Black/Brown/McAnally! January 22-23, Tampa, Florida Info and registration at http://www.thecompleatrubyist.com