[#1816] Ruby 1.5.3 under Tru64 (Alpha)? — Clemens Hintze <clemens.hintze@...>

Hi all,

17 messages 2000/03/14

[#1989] English Ruby/Gtk Tutorial? — schneik@...

18 messages 2000/03/17

[#2241] setter() for local variables — ts <decoux@...>

18 messages 2000/03/29

[ruby-talk:02152] begin/else

From: Clemens Hintze <c.hintze@...>
Date: 2000-03-25 07:44:43 UTC
List: ruby-talk #2152
Dave Thomas writes:
> 
> Guess what I'm documenting today ;-)
> 
> Is there any difference at all between
> 
>    begin
>     codeA
>    rescue
>     ...
>    else
>     codeB
>    end
> 
> and
> 
>    begin
>      codeA
>      codeB
>    rescue
>     ...
>    end
> 
> (assuming codeB doesn't throw an exception?)

All exceptions that occure in the 'else' part will not be catched by
the 'rescue' clauses of that 'begin'...'end' construct. That is
indicated by requiring that the 'else' clause have to come after *all* 
'rescue' clauses.

So, as you assume codeB will not throw an exception, there is no
difference except that codeB is not potentially protected.

BTW: You said that you would include the

   begin
     :
   end until ...

construct in the FAQ. Will you also document it in the book?

> 
> 
> Dave
> 

\cle

-- 
Clemens Hintze  mailto: c.hintze@gmx.net

In This Thread