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: How to exit out of a function ? what is try-catch-throw in terms of Program Counter Date: Sat, 20 Oct 2007 20:45:58 -0000 Organization: http://groups.google.com Message-ID: <1192913158.922454.108100@k35g2000prh.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" X-Trace: ger.gmane.org 1192916439 16539 80.91.229.12 (20 Oct 2007 21:40:39 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 20 Oct 2007 21:40:39 +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:40:40 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 1IjM3i-0003AC-Cw for geh-help-gnu-emacs@m.gmane.org; Sat, 20 Oct 2007 23:40:38 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IjM3a-0006sg-Kz for geh-help-gnu-emacs@m.gmane.org; Sat, 20 Oct 2007 17:40: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: 39 Original-NNTP-Posting-Host: 75.31.71.39 Original-X-Trace: posting.google.com 1192913159 20679 127.0.0.1 (20 Oct 2007 20:45:59 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Sat, 20 Oct 2007 20:45:59 +0000 (UTC) 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:153135 comp.lang.c:827771 comp.lang.c++:954191 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:48641 Archived-At: 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.