Reserved Words

last modified: February 12, 2011

KeyWords used by a system which may not be used as names of variables, functions or constants.

Most compilers, languages, and systems maintain a list of the words in a ReservedWordList, available to the user through help or other IDE features.

"Algol60 was the first programming language to have ReservedWords."

ALGOL 60 had, in fact _no_ reserved words. What would be keywords in today's languages were in fact separate symbols in the language, distinguished from identifiers by a StroppingConvention. The most common ones were the use of underlining or apostrophes:

'if' x < 0 'then' x := -x;

or

i_f_ x < 0 t_h_e_n_ x := -x;

However, not all ALGOL compilers implemented a StroppingConvention. Leaving symbols such as if and then unstropped meant, of course, that they had to be reserved. This was a violation of the standard, but common nonetheless.

In the reference language, these symbols were most commonly denoted in boldface, so in a publication the above examples would read:

if x < 0 then x := - x;

The upshot of all this is that one could write

if if < 0 then if := - if;

but I don't think it would have been encouraged.


As opposed to RegisteredWords in Hyper ArtifactOrientedProgramming


Loading...