4 ms·
> Addresses were not plain numbers; they were more like Unix paths, as in /program/function/variable/arrayindex. How do I address a variable within a function
by heavenlyblue 4y ago
> Addresses were not plain numbers; they were more like Unix paths, as in /program/function/variable/arrayindex.
How do I address a variable within a function that was recursed into twice?
- Taniwha 4y agoyou create an in-scope reference within the function - and then 'stuff' it which converts it into an offset from the base of the stack - converts an "indirect reference word" into a "stuffed indirect reference word"
- Taniwha 4y agoit's what you use to pass by reference ..... but algol supports pass-by-name semantics (of which pass by reference is an optimisable subset) - to do fill pass by name (for a simple example a[i] where i is a global) the compiler will create a thunk (a tiny subroutine, in scope of the place where the parameter was passed) and pass a pointer to it - the tag of '7' means a PCW - when it gets dereferenced as a pointer the hardware does a subroutine call to the thunk in the correct scope