lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

> 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."

	"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."