Re: Is multi-level function return possible?

anton@mips.complang.tuwien.ac.at (Anton Ertl)
Tue, 11 Mar 2014 13:04:57 GMT

          From comp.compilers

Related articles
Is multi-level function return possible? noitalmost@cox.net (noitalmost) (2014-03-10)
Re: Is multi-level function return possible? kaz@kylheku.com (Kaz Kylheku) (2014-03-11)
Re: Is multi-level function return possible? anton@mips.complang.tuwien.ac.at (2014-03-11)
Re: Is multi-level function return possible? gneuner2@comcast.net (George Neuner) (2014-03-11)
Re: Is multi-level function return possible? lkrupp@pssw.com (Louis Krupp) (2014-03-11)
Re: Is multi-level function return possible? kaz@kylheku.com (Kaz Kylheku) (2014-03-11)
Re: Is multi-level function return possible? tkowaltowski@gmail.com (Tomasz Kowaltowski) (2014-03-12)
Re: Is multi-level function return possible? anton@mips.complang.tuwien.ac.at (2014-03-13)
Re: Is multi-level function return possible? yaldnif.w@blueyonder.co.uk (Bill Findlay) (2014-03-14)
[31 later articles]
| List of all articles for this month |

From: anton@mips.complang.tuwien.ac.at (Anton Ertl)
Newsgroups: comp.compilers
Date: Tue, 11 Mar 2014 13:04:57 GMT
Organization: Institut fuer Computersprachen, Technische Universitaet Wien
References: 14-03-020
Keywords: code, Pascal
Posted-Date: 11 Mar 2014 17:00:35 EDT

noitalmost <noitalmost@cox.net> writes:
>Is this a doable thing for a Pascal-like language that is meant to be
>compiled? I have a multi-level break which works within a procedure, but the
>return across procedure boundaries seems to add a lot of complications.


Yes, in Pascal you can goto a label that is in a containing procedure
or function, even across several levels. That is a very rarely used
feature of the language, and Wirth removed it (along with goto) from
his later languages.


The more common feature is to have exceptions that you can throw and
that can be caught in a function/procedure/method several levels
further out.


The difference between these languages features is that Pascal's goto
is statically scoped, whereas exceptions are dynamically scoped.


- anton
--
M. Anton Ertl
anton@mips.complang.tuwien.ac.at
http://www.complang.tuwien.ac.at/anton/


Post a followup to this message

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