From: Clemens Hintze Date: 2000-03-05T23:28:15+01:00 Subject: [ruby-talk:01728] Re: [Ruby] static buffers >>>>> "Dave" == Dave Thomas writes: Dave> Yukihiro Matsumoto writes: ... Dave> What about using parameter passing semantics: Dave> rescue FriendlyException(friendly) Dave> and then extend it to Dave> rescue FriendlyException, UglyException(mixed) Dave> and Dave> rescue (anyException) Dave> In a way, the Exception object you pass in _is_ like a Dave> parameter to the rescue pseudo-block. I like that syntax, but didn't that get confused with method calling? I know it is not the normal way, but nowadays I could code something like this: exceptions = [SyntaxError, TypeError] def Exception(val) case val when 1 SyntaxError when 2 TypeError end end for i in 0..1 begin raise exceptions[i] rescue Exception(1) print "Catched SyntaxError\n" rescue Exception(2) print "Catched TypeError\n" end end That would not work anymore with your proposal, would it? Matz proposal would also not work because I can do things like that now: def fn(*args) for arg in args print "type of '#{arg}' = #{arg.type}\n" end end fn SyntaxError => 12 So perhaps we need a new syntax like: rescue SyntaxError: friendly But perhaps we want to use the ':' for named argument passing ... I do not know whether that would conflicts with it? Dave> Regards Dave> Dave Regards too, \cle -- Clemens Hintze mailto: c.hintze@gmx.net