3 # $Id: except.ruby,v 1.1.1.1 2004-05-19 18:09:43 bfulgham Exp $
4 # http://www.bagley.org/~doug/shootout/
8 NUM
= Integer(ARGV[0] || 1)
11 class Lo_Exception
< Exception
18 class Hi_Exception
< Exception
25 def some_function(num
)
29 print
"We shouldn't get here, exception is: #{$!.type}\n"
51 raise Lo_Exception
.new(num
)
53 raise Hi_Exception
.new(num
)
61 print
"Exceptions: HI=", $HI, " / LO=", $LO, "\n"