Hugh Sasse Staff Elec Eng wrote:
> 
> On Wed, 8 Nov 2000, Yukihiro Matsumoto wrote:
> ...
> > Ah, could you tell me about your short-curcuit operator idea again?
> > I'm too easy to forget.
> 
> It was to do with sort! producing nil so that chains of methods "break"
> 
> myarray.sort!.uniq!.print
> 
> could raise an exception, but
> 
> myarray.sort!.cut.uniq!.cut.print
> 
> meant:
> myarray.sort! If the result is nil then do mo more of this statement
> otherwise myarray.uniq! and if the result is nil do no more of the
> statement otherwise myarray.print.
> 

What about this alternative:

myarray.sort! ? (myarray.uniq! ? myarray.print : nil) : nil


Guy N. Hurst

-- 
HurstLinks Web Development    http://www.hurstlinks.com/
Norfolk, VA - (757)623-9688
PHP/MySQL - Ruby/Perl - HTML/Javascript