"Hal E. Fulton" <hal9000 / hypermetrics.com> wrote:

> Would something like this make sense?
>
>   mymeth(myargs) rescue { puts "mymeth failed"; exit }
>
> It's not current syntax. I'm asking whether
> it would make sense to add it.
>
> Hal
>
> --
> Hal Fulton
> hal9000 / hypermetrics.com
>
>


I thought rescue modifier was for the current line.
Isn't there a conflict when there's a rescue in the
method def ?


def mymeth(args)
  MATH::PI / args
#rescue                            # <-- uncomment & re-run
  puts "Do you mean; insert/replace me ?"
end

mymeth(0) rescue begin
  puts "This line failed 1"
###  exit
end

mymeth(undefined) rescue begin
  puts "This line failed 2"
###  exit
end


2 pence,

daz