------art_68511_26964719.1165918792958
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

On 12/12/06, Robert Klemme <shortcutter / googlemail.com> wrote:
>
> On 12.12.2006 00:15, Dave Thomas wrote:
> >
> > On Dec 11, 2006, at 7:55 AM, Robert Klemme wrote:
> >
> >> What bugs me is that the "else" clause is not executed if it is left
> >> via a "return".  Taking the Pickaxe 2nd edition pg. 362 literally ("If
> >> an else clause is present, its body is executed if no exceptions were
> >> raised in code.") it would have to be executed in that case, too.  So,
> >> if the interpreter would behave as stated in the book, there was
> >> actually a difference between the code at the end of the block and the
> >> code inside the else clause.
> >
> > Why would you expect the else clause to be executed if a return is
> > executed? That seems counter-intuitive to me.
>
> I have low expectations with regard to the "else" clause but the book
> clearly states that it is executed if there was no exception - that
> includes the case where the block is left via a "return".  Behavior and
> description simply are not in sync, that's my point.
>
> I can't remember ever having used this type of "else" clause so far so I
> am pretty nonreligious about it.  Although I can imagine a situation
> where I would want to make sure some cleanup code is executed only when
> there was no error in the block - and this includes leaving via
> "return".


and that is what ensure is for, right?
I guess the book is wrong and Matz is right ;), well my POV

  Of course you can argue that leaving via "return" is a non
> standard way to leave the block...  As I said, I am pretty relaxed here.
>   I just think this needs some clarification - either way or the other.
>
> Kind regards
>
>         robert




Likewise
>


-- 
"The real romance is out ahead and yet to come. The computer revolution
hasn't started yet. Don't be misled by the enormous flow of money into bad
defacto standards for unsophisticated buyers using poor adaptations of
incomplete ideas."

- Alan Kay

------art_68511_26964719.1165918792958--