At Sat, 15 Dec 2001 10:09:28 +0900,
Thom Harp <thomharp / charter.net> wrote:
> We'd need some more syntax to indicate that I want to ignore that exception,
> like maybe declare a block so that if a certain exception is raised from a
> function called within that block, control resumes normally where that function
> would have returned to the block, like:
> 
>       trap('SIGCHLD') do
>          ignore(Errno::ECHILD) do
>             while( (pid = Process.waitpid(-1,Process::WNOHANG)))
>             end
>          end
>       end
> 
> Or is there a way I could code this in Ruby?

  def ignore(exc)
    yield
  rescue exc
  end


Nobu Nakada