From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,2cb1f0b6d642e1dc X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news1.google.com!newsfeed2.dallas1.level3.net!news.level3.com!bloom-beacon.mit.edu!newsswitch.lcs.mit.edu!nntp.TheWorld.com!not-for-mail From: Robert A Duff Newsgroups: comp.lang.ada Subject: Re: Pascal Calling Convention Date: Sat, 26 Mar 2011 15:51:08 -0400 Organization: The World Public Access UNIX, Brookline, MA Message-ID: References: <9b04626e-567d-408c-aab3-39b964b3ffd6@l2g2000prg.googlegroups.com> <4d8ccaa3$0$26415$882e7ee2@usenet-news.net> <4d8cd25d$0$28492$882e7ee2@usenet-news.net> NNTP-Posting-Host: shell01.theworld.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: pcls6.std.com 1301169068 17355 192.74.137.71 (26 Mar 2011 19:51:08 GMT) X-Complaints-To: abuse@TheWorld.com NNTP-Posting-Date: Sat, 26 Mar 2011 19:51:08 +0000 (UTC) User-Agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.3 (irix) Cancel-Lock: sha1:95xxDzeTp5ZPvFe2P7u4pFiO/3c= Xref: g2news2.google.com comp.lang.ada:19448 Date: 2011-03-26T15:51:08-04:00 List-Id: Hyman Rosen writes: > On 3/25/2011 1:09 PM, Robert A Duff wrote: >> Hyman Rosen writes: >> >>> On 3/25/2011 12:04 PM, Robert A Duff wrote: >>>> There must be a stack. >>> >>> Why? >> >> Because Ada supports recursion, which implies a LIFO data structure -- >> a stack. One per task, in fact. > > Recursion just implies that when a procedure is called (or when any > local scope is entered) it is allocated a separate set of its local > variables. That can be done with tree-like allocation structures > instead of a stack. I'm not sure exactly what you mean by these tree-like things, but I think each branch of that tree is really a stack. I'll make an even bolder claim: Even without recursion and tasking, there is always an implicit stack in Ada. That's because of the way block statements and procedure calls are defined -- local variables are created and destroyed (and initialized and finalized) in a LIFO manner, and that's a stack, no matter how that stack is implemented. >...In continuation-passing languages with garbage > collection, returning from a procedure or exiting a scope does not > imply freeing the variables of that scope, because that scope can > be re-entered. Sure, but that's not Ada. - Bob