[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Performance vs flexibility
- From: Luiz Henrique de Figueiredo <lhf@...>
- Date: Thu, 8 Jan 2015 11:43:01 -0200
> If you mean that each global would be given a number and then access to it
> would just index an array with that number
A historical note: BCPL did exactly that but the programmer was responsible
for assigning numbers:
"There are no user-declarable global variables; instead there is
a global vector, which is similar to "blank common" in Fortran."
http://en.wikipedia.org/wiki/BCPL#Design
"An interesting concept in BCPL is the so called global vector. It
is the only global data object in the language, and its contents
are directly accessible from any part of the program. [...]
In order to access global data, one needs to know where in the
global vector it is stored. Associations of names with locations
in the global vector can be stored in 'header files'. Inclusion
of such files at compilation time ensures that the global data
is shared across different compilation units."
http://www.math.bas.bg/bantchev/place/bcpl.html