Path: csiph.com!usenet.pasdenom.info!aioe.org!eternal-september.org!feeder.eternal-september.org!news.iecc.com!.POSTED!nerds-end From: federation2005@netzero.com Newsgroups: comp.compilers Subject: Re: Is multi-level function return possible? Date: Wed, 26 Mar 2014 17:39:25 -0700 (PDT) Organization: Compilers Central Lines: 32 Sender: news@iecc.com Approved: comp.compilers@iecc.com Message-ID: <14-03-065@comp.compilers> References: <14-03-020@comp.compilers> <14-03-023@comp.compilers> NNTP-Posting-Host: news.iecc.com Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: miucha.iecc.com 1395881736 16797 2001:470:1f07:1126:0:676f:7373:6970 (27 Mar 2014 00:55:36 GMT) X-Complaints-To: abuse@iecc.com NNTP-Posting-Date: Thu, 27 Mar 2014 00:55:36 +0000 (UTC) Keywords: code Posted-Date: 26 Mar 2014 20:55:36 EDT X-submission-address: compilers@iecc.com X-moderator-address: compilers-request@iecc.com X-FAQ-and-archives: http://compilers.iecc.com Xref: csiph.com comp.compilers:1187 On Tuesday, March 11, 2014 12:56:01 PM UTC-5, George Neuner wrote: > The modern term is "exception". See also "non-local" control > transfer, exit and/or return, and "escape" or "backtracking" > continuation. Right, the contemporary (not "modern") [Note 1] notion is the catch-throw paradigm. I like to think of it as the "cap and trap" mechanism. I believe it originates with Prolog in the 1970's, since (a) catch and throw are part of Prolog's library of built-in functions, and (b) the multi-level breakout has always been an integral part of its run-time system. Some C compilers implement it as well, not just C++. And in more recent times (i.e. since the late 20th century) it's found its way directly in the CPUs' architectures as a kind of alternative to the "interrupt". The idea may also be motivated, in part, by the Curry-Howard isomorphism, which relates the "AND", "OR" and "IF-THEN" connectives of Intuitionist logic respectively to the product, union and function types. When the scope of the correspondence is extended to classical logic, it connects Pierce's Rule to the catch-throw mechanism. Look under the Wikipedia entry, for instance, which also points to the call/cc mechanism of Scheme and to the related notion of continuation passing. Note 1: USENET articles are read as much as 33 years after they're written (so far), by an audience who will see "modern" as parochially "presentist", i.e. 33 years dated. Google's people have been guilty of this too, lately.