From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Joel Yliluoma Newsgroups: gmane.emacs.help 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 Organization: TDC Song Internet Services Message-ID: References: <1192913158.922454.108100@k35g2000prh.googlegroups.com> NNTP-Posting-Host: lo.gmane.org X-Trace: ger.gmane.org 1193186446 3547 80.91.229.12 (24 Oct 2007 00:40:46 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 24 Oct 2007 00:40:46 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Oct 24 02:40:46 2007 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1IkUIe-0004gA-NU for geh-help-gnu-emacs@m.gmane.org; Wed, 24 Oct 2007 02:40:44 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IkUIW-0000B4-DL for geh-help-gnu-emacs@m.gmane.org; Tue, 23 Oct 2007 20:40:36 -0400 Original-Path: shelby.stanford.edu!headwall.stanford.edu!newshub.sdsu.edu!feeder.news-service.com!216.196.110.148.MISMATCH!border1.nntp.ams.giganews.com!nntp.giganews.com!uio.no!fi.sn.net!newsfeed1.fi.sn.net!news.song.fi!not-for-mail Original-Newsgroups: gnu.emacs.help,comp.lang.c,comp.lang.c++ Original-Followup-To: comp.lang.c++ User-Agent: slrn/0.9.8.1pl1 (Debian) Original-Lines: 16 Original-NNTP-Posting-Host: bisqwit.iki.fi Original-X-Trace: 1193184146 news.song.fi 3511 194.29.198.4:42218 Original-X-Complaints-To: abuse@song.fi Original-Xref: shelby.stanford.edu gnu.emacs.help:153256 comp.lang.c:828405 comp.lang.c++:954514 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:48744 Archived-At: 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)