Subject: Re: copying a vector? (Stalin 0.9?)
From: (Rob Warnock)
Date: 8 Jan 2001 02:32:22 GMT
Newsgroups: comp.lang.scheme
Message-ID: <93b8rm$ljpgh$>
Hartmann Schaffer <hs@paradise.nirvananet> wrote:
>Rob Warnock <> wrote:
| >variables could *always* be allocated on the stack (even if mutated),
| >and thus argument thunks only had to look one level up in the dynamic
| >environment (using the frame link) to access lexicals anywhere in the
| >caller.
| no, it didn't quite work that way.  the argument could have been
| accessed from a nested procedure.  afair the common implementation
| technique (don't know about algol-10) was to pass a
| codepointer/framepointer pair

Aha! Now it's coming back to me. ALGOL-10 used a "display", which was
accessible from the dynamic link (frame pointer), to handle access to
lexicals. So even if an argument was passed from a nested procedure,
looking just "up one" from the current frame pointer would get you the
lexical context of said nested procedure, and from *its* display you
can get to any of the lexicals which were visible to it (including those
in routines in which it was nested).

Or said another way, thunks passed as arguments only have to get back
to the environment of the calling routine (if if it was nested), and
*that* they can do using only the current frame-pointer/return-link.
So the arg itself was *only* a (pair of) code pointer(s).


p.s. I suppose I could draw an ugly ASCII picture if this is
     still unclear...  ;-}

Rob Warnock, 31-2-510
SGI Network Engineering
1600 Amphitheatre Pkwy.		Phone: 650-933-1673
Mountain View, CA  94043	PP-ASEL-IA