4 ms·
> BCPL [...] used an area of memory called the global vector [...] to allow separately compiled modules to share variables. The GLOBAL declaration allowed the p
by amiga386 2y ago
> BCPL [...] used an area of memory called the global vector [...] to allow separately compiled modules to share variables. The GLOBAL declaration allowed the programmer to name elements of the global vector, and there was a rule that global variables would be initialised to the entry points of functions if their names matched the names of declared global variables. This initialisation took place when modules were loaded. [...] this mechanism is not beautiful and much hated by some
"Not beautiful and much hated by some" is a masterful piece of understatement.
This is what a GLOBAL declaration looks like:
GLOBAL
$(
printf : 89
programmeriq : 90
$)
You're reading that correctly. There is no symbolic linkage in the language. You declare the specific numeric slot in a global array you think your function or global variable should occupy. You hope nobody else uses the same ones. That's how you call functions defined in other compilation units.
- andrewf 2y agoSounds like the COMMON section in BASIC. Although there you couldn't even supply indexes. "Remember that variable order and type are significant, not variable names. The order and type of variables must be the same for all COMMON statements communicating between chaining programs." -- http://qbasicnews.com/qboho/#topic-qb45advr-T0085 http://qbasicnews.com/qboho/#topic-qb45advr-T0085
- helpfulContrib 2y ago.. or Zero-page in 6502, which is like a page of registers which everyone has to agree on meaning ..
- immibis 2y agoSounds like declaring a uniform buffer in GLSL. Everything old is new again!