X-Received: by 10.182.22.133 with SMTP id d5mr3771972obf.27.1394818460537; Fri, 14 Mar 2014 10:34:20 -0700 (PDT) Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.glorb.com!l13no6385345iga.0!news-out.google.com!du2ni6137qab.0!nntp.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!news.iecc.com!.POSTED!nerds-end From: Bill Findlay Newsgroups: comp.compilers Subject: Re: Is multi-level function return possible? Date: Fri, 14 Mar 2014 01:28:03 +0000 Organization: Compilers Central Lines: 16 Sender: news@iecc.com Approved: comp.compilers@iecc.com Message-ID: <14-03-028@comp.compilers> References: <14-03-020@comp.compilers> <14-03-022@comp.compilers> <14-03-025@comp.compilers> <14-03-027@comp.compilers> NNTP-Posting-Host: news.iecc.com Mime-Version: 1.0 X-Trace: miucha.iecc.com 1394818458 21412 2001:470:1f07:1126:0:676f:7373:6970 (14 Mar 2014 17:34:18 GMT) X-Complaints-To: abuse@iecc.com NNTP-Posting-Date: Fri, 14 Mar 2014 17:34:18 +0000 (UTC) Keywords: Pascal, comment Posted-Date: 14 Mar 2014 13:34:18 EDT X-submission-address: compilers@iecc.com X-moderator-address: compilers-request@iecc.com X-FAQ-and-archives: http://compilers.iecc.com Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Xref: csiph.com comp.compilers:1150 > [Yes, it's lexically scoped. Pascal functions use displays, which > keep the frame pointers of all of the lexically enclosing blocks with > variables visible in a routine, which are filled in by chasing > pointers to the calling function's display. So in case of recursion, > the display has the most recent frame pointer. You can't get much > more complicated than this and still use a single stack. -John] None of the Pascal compilers I worked on used a display; instead they chased the static chain if necessary to access a non-local. -- Bill Findlay with blueyonder.co.uk; use surname & forename; [Oh, right. That works, too, and is probably better if non-local references are uncommon. -John]