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: Bill Findlay Newsgroups: comp.compilers Subject: Re: Is multi-level function return possible? Date: Mon, 17 Mar 2014 16:15:27 +0000 Organization: Compilers Central Lines: 26 Sender: news@iecc.com Approved: comp.compilers@iecc.com Message-ID: <14-03-047@comp.compilers> References: <14-03-020@comp.compilers> <14-03-022@comp.compilers> <14-03-025@comp.compilers> <14-03-030@comp.compilers> <14-03-044@comp.compilers> <14-03-046@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 1395073204 82570 2001:470:1f07:1126:0:676f:7373:6970 (17 Mar 2014 16:20:04 GMT) X-Complaints-To: abuse@iecc.com NNTP-Posting-Date: Mon, 17 Mar 2014 16:20:04 +0000 (UTC) Keywords: Pascal, algol60, history, comment Posted-Date: 17 Mar 2014 12:20:04 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:1169 On 16/03/2014 19:45, "Andy Walker" wrote: > On 16/03/14 17:19, Anton Ertl wrote: >> Language design note: Given that nested functions have fallen out of >> favour in the Algol-family world (in C and its offspring), I wonder if >> they only really gain usefulness when combined with first-class >> closures. It would be wrong to imply that "the Algol-family world" consists of "C and its offspring". Algol has many descendants that have have remained more loyal to their family traditions, Ada 2012 first among them. > They are also useful for variable hiding and space reclamation. > If all functions are at the outermost level, then they can only access > local or global variables, and so can communicate with each other only > via globals or parameters. Global space can never be reclaimed except > through sophisticated optimisations, and parameters have a run-time cost. Exactly. Nested functions also permit information hiding and the tidying of code by the introduction of abstractions that have only local relevance. -- Bill Findlay with blueyonder.co.uk; use surname & forename; [C fakes it with module static, but I take your point. -John]