Re: Is multi-level function return possible?

federation2005@netzero.com
Wed, 26 Mar 2014 17:39:25 -0700 (PDT)

          From comp.compilers

Related articles
[28 earlier articles]
Re: Is multi-level function return possible? gah@ugcs.caltech.edu (glen herrmannsfeldt) (2014-03-21)
Re: Is multi-level function return possible? anton@mips.complang.tuwien.ac.at (2014-03-24)
Re: Is multi-level function return possible? gah@ugcs.caltech.edu (glen herrmannsfeldt) (2014-03-24)
Re: Is multi-level function return possible? gneuner2@comcast.net (George Neuner) (2014-03-26)
Re: Is multi-level function return possible? news@cuboid.co.uk (Andy Walker) (2014-03-26)
Re: Is multi-level function return possible? news@cuboid.co.uk (Andy Walker) (2014-03-26)
Re: Is multi-level function return possible? federation2005@netzero.com (2014-03-26)
Re: Is multi-level function return possible? DrDiettrich1@aol.com (Hans-Peter Diettrich) (2014-03-27)
Re: catch and throw, was Is multi-level function return possible? rpw3@rpw3.org (2014-03-27)
Re: catch and throw, was Is multi-level function return possible? kaz@kylheku.com (Kaz Kylheku) (2014-03-27)
Re: catch and throw, was Is multi-level function return possible? usenet@bitblocks.com (Bakul Shah) (2014-03-26)
Re: catch and throw, was Is multi-level function return possible? gah@ugcs.caltech.edu (glen herrmannsfeldt) (2014-03-27)
Re: exception catching in PL/I robin51@dodo.com.au (Robin Vowels) (2014-03-28)
[13 later articles]
| List of all articles for this month |
From: federation2005@netzero.com
Newsgroups: comp.compilers
Date: Wed, 26 Mar 2014 17:39:25 -0700 (PDT)
Organization: Compilers Central
References: 14-03-020 14-03-023
Keywords: code
Posted-Date: 26 Mar 2014 20:55:36 EDT

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.


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.