From: Joel VanderWerf Date: 2002-02-12T04:21:27+09:00 Subject: Re: rescue syntax Alan Chen wrote: ... > Would the option of attaching rescue conditions to arbitrary code blocks be desireable? > For methods, I'd imagine something like the following > > def method > # method logic > rescue > # oops, bad logic > end That works already: irb(main):036:0> def div x irb(main):037:1> 3/x irb(main):038:1> rescue Exception irb(main):039:1> puts "Argh!" irb(main):040:1> end nil irb(main):041:0> div 0 Argh! nil irb(main):043:0> RUBY_VERSION "1.6.6" -- Joel VanderWerf California PATH, UC Berkeley mailto:vjoel@path.berkeley.edu Ph. (510) 231-9446 http://www.path.berkeley.edu FAX (510) 231-9512