From: dblack@... Date: 2003-05-15T02:30:29+09:00 Subject: Re: ruby_run() w/o exit? Hi -- On Thu, 15 May 2003, Simon Strandgaard wrote: > BTW: I fixed your class so that it works correctly now. Almost :-) > class Howard > class TooPainFulError < StandardError; end > > def initialize > @langs = %w(ruby c perl java idl bash sh zsh tcsh csh fortran c++) > end > > def rank lang > raise NotImplementedError, lang unless @langs.index lang You've eliminated the assignment to i, which means that this: > case lang > when /[^+]$/ > puts "#{lang} is my ##{i} ranked language" raises an exception. The original line: raise NotImplementedError, lang unless i = @langs.index lang didn't parse. Ara, in cases like this you might have to compromise on the boycotting of parentheses :-) raise NotImplementedError, lang unless i = @langs.index(lang) David -- David Alan Black home: dblack@superlink.net work: blackdav@shu.edu Web: http://pirate.shu.edu/~blackdav