From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: gnuist006@gmail.com Newsgroups: gmane.emacs.help Subject: Re: How to exit out of a function ? what is try-catch-throw in terms of Program Counter Date: Sat, 20 Oct 2007 20:57:43 -0000 Organization: http://groups.google.com Message-ID: <1192913863.591332.146750@k35g2000prh.googlegroups.com> References: <1192913158.922454.108100@k35g2000prh.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" X-Trace: ger.gmane.org 1192916500 16710 80.91.229.12 (20 Oct 2007 21:41:40 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 20 Oct 2007 21:41:40 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Oct 20 23:41:41 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 1IjM4g-0003Sl-9z for geh-help-gnu-emacs@m.gmane.org; Sat, 20 Oct 2007 23:41:38 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IjM4Y-0007IZ-RN for geh-help-gnu-emacs@m.gmane.org; Sat, 20 Oct 2007 17:41:30 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!postnews.google.com!k35g2000prh.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help,comp.lang.c,comp.lang.c++ Original-Lines: 42 Original-NNTP-Posting-Host: 75.31.71.39 Original-X-Trace: posting.google.com 1192913864 22728 127.0.0.1 (20 Oct 2007 20:57:44 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Sat, 20 Oct 2007 20:57:44 +0000 (UTC) In-Reply-To: <1192913158.922454.108100@k35g2000prh.googlegroups.com> User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.8.1.7) Gecko/20070914 Firefox/2.0.0.7,gzip(gfe),gzip(gfe) Complaints-To: groups-abuse@google.com Injection-Info: k35g2000prh.googlegroups.com; posting-host=75.31.71.39; posting-account=ps2QrAMAAAA6_jCuRt2JEIpn5Otqf_w0 Original-Xref: shelby.stanford.edu gnu.emacs.help:153138 comp.lang.c:827773 comp.lang.c++:954193 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:48643 Archived-At: On Oct 20, 1:45 pm, gnuist...@gmail.com wrote: > I have some code like this: > > (if (test) > (exit) > (do something)) > > or > > (if (test) > ( do something) > (exit)) > > Various levels of nestings. > > I have several questions, basic to sophisticated. > > (1) What is the lisp equivalent idiom for (exit) as in bash or > in C. > (2) What is the best practice to handle this kind of problems? > > (3) What is the intermediate practice to handle this kind of > problems. > > 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 cant > really visualize the construct in terms of C. That is what my > brain can process. If you understand it so well, you can show > me how one would really implement that kind of construct in > C and then by extension I can see that kind of program flow > in LISP. Whether its imperative programming or functional, > beneath there is program counter and assembly. C is close > to machine so much that it is almost assembly. So understanding try-c- > t in C is equivalent to understanding at > the level of machine language. > > I therefore take the liberty to crosspost in C and C++ groups. Is there any explanation of try-catch-throw in terms of gotos than PC ? Is that explanation more simpler ?