[#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:02155] Re: begin/else

From: matz@... (Yukihiro Matsumoto)
Date: 2000-03-25 13:59:26 UTC
List: ruby-talk #2155
Hi,

In message "[ruby-talk:02149] begin/else"
    on 00/03/24, Dave Thomas <Dave@thomases.com> writes:

|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?)

No technical difference on that assumption.

Psychologically, It emphasizes more explicitly the fact that codeB
would be executed after codeA's success.

In message "[ruby-talk:02151] Re: begin/else"
    on 00/03/24, "Dat Nguyen" <thucdat@hotmail.com> writes:

|In the second case, codeB will be executed anyway no matter if codeA throws 
|an exception or not.

No, that effect is done by 'ensure' keyword.

							matz.

In This Thread

Prev Next