Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.glorb.com!news-out.readnews.com!news-xxxfer.readnews.com!news.misty.com!news.iecc.com!.POSTED!nerds-end From: anton@mips.complang.tuwien.ac.at (Anton Ertl) Newsgroups: comp.compilers Subject: Re: Is multi-level function return possible? Date: Tue, 11 Mar 2014 13:04:57 GMT Organization: Institut fuer Computersprachen, Technische Universitaet Wien Lines: 22 Sender: news@iecc.com Approved: comp.compilers@iecc.com Message-ID: <14-03-022@comp.compilers> References: <14-03-020@comp.compilers> NNTP-Posting-Host: news.iecc.com X-Trace: miucha.iecc.com 1394571635 64907 64.57.183.58 (11 Mar 2014 21:00:35 GMT) X-Complaints-To: abuse@iecc.com NNTP-Posting-Date: Tue, 11 Mar 2014 21:00:35 +0000 (UTC) Keywords: code, Pascal Posted-Date: 11 Mar 2014 17:00:35 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:1144 noitalmost 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/