Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.glorb.com!usenet.stanford.edu!news.iecc.com!.POSTED!nerds-end From: Marco van de Voort Newsgroups: comp.compilers Subject: Re: Is multi-level function return possible? Date: Fri, 14 Mar 2014 19:38:24 +0000 (UTC) Organization: Stack Usenet News Service Lines: 23 Sender: news@iecc.com Approved: comp.compilers@iecc.com Message-ID: <14-03-033@comp.compilers> References: <14-03-020@comp.compilers> <14-03-022@comp.compilers> <14-03-031@comp.compilers> NNTP-Posting-Host: news.iecc.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: miucha.iecc.com 1394829287 61431 2001:470:1f07:1126:0:676f:7373:6970 (14 Mar 2014 20:34:47 GMT) X-Complaints-To: abuse@iecc.com NNTP-Posting-Date: Fri, 14 Mar 2014 20:34:47 +0000 (UTC) Keywords: design, code, Pascal Posted-Date: 14 Mar 2014 16:34:46 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:1155 On 2014-03-14, George Neuner wrote: >>... 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. > > Interesting. I was not aware of this, and it is not mentioned in any > of several Pascal books I have from the early 80's. Other than > Wirth's own, I wonder how many implementations actually allowed it? GPC and several of the other ISO aspirants I assume. Free Pacal added it in its ISO mode too, though much more recently (afaik the current production 2.6.x series). Some examples are in the testsuite here: http://svn.freepascal.org/cgi-bin/viewvc.cgi/trunk/tests/test/ tisogoto* are the interprocedural goto tests, specially http://svn.freepascal.org/cgi-bin/viewvc.cgi/trunk/tests/test/tisogoto1.pp?revision=15710&view=markup tmaclocalprocparam* are the closurelike functionality P.s. Delphi 2009 has a closure like feature too, called "anonymous methods".