help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to exit out of a function ? what is try-catch-throw in terms of


From: Joel Yliluoma
Subject: Re: How to exit out of a function ? what is try-catch-throw in terms of Program Counter
Date: 24 Oct 2007 00:02:26 GMT
User-agent: slrn/0.9.8.1pl1 (Debian)

On Tue, 23 Oct 2007 12:33:17 -0400, Stefan Monnier wrote:
>> NOTE: I am really afraid of try-catch-throw. I have never been
>> able to understand it since it does not exist in C and I can't
>> really visualize the construct in terms of C. That is what my
>
> Actually, these constructs pretty much exist in C as well:
> `catch' is called `setjmp', and `throw' is called `longjmp'.

If you ignore the thing about scope that I was being very careful
to illustrate properly, then yes.
And, the fact that try-catch blocks can be nested, recursed, etc,
and only catching the matching type of exception stops the unwinding.

-- 
Joel Yliluoma - http://bisqwit.iki.fi/
: comprehension = 1 / (2 ^ precision)


reply via email to

[Prev in Thread] Current Thread [Next in Thread]