User guide
14 CHAPTER 2. THE BCPL LANGUAGE
2.1.4 Section Brackets
Historically BCPL used the symbols $( and $) to bracket commands and decla-
rations. These symbols are called section brackets and are allowed to be fol lowed
by tags composed of letters, digits, dots and underlines. A tagged closing section
bracket is forced to match with its corresponding open section bracket by the
automatic inserti on of extra closing brackets as needed. Use of this mechanism is
no longer recommended since it can lead to obscure programming errors. BCPL
has been extended to allow all untagged section brackets to be r e p l aced by { and
} as appropriate.
2.2 Expressions
Expressions are composed of names, constants a n d expression operators and may
be grouped using parentheses. The precedence and associativity of the different
expression constructs is given in Section 2.2 . 9. In the most implementation of
BCPL expressions yi el d values that ar e 32 bits long, but now 64 bit implemen-
tations are becom i n g more common.
2.2.1 Names
Syntactically a name is of a sequence of letters, digit s, d ot s an d un d e rl i n es star t ing
with a letter tha t is not one of the reserved words (such as IF, WHILE, TABLE).
The use of dots in names is no longer recommended, and should be replaced by
underscores.
A name may be declared as a l ocal variable, a static varia b l e, a global variable,
a manifest constant, a label or a funct i on. Since the langu ag e is typeless, the value
of a name is a bit pattern whose interpretation depends on how it is used.
2.2.2 Constants
Decimal numbers consist of a sequen ce of digits, while binary, octal or hexadeci-
mal are represented, respectively, by #b, #o or #x followed by digits of the appro-
priate sort. Th e case of the letters in hexadecimal numbers is not significant nor
is the case of the letters b, o or x after #. The o may be omitted in octal num-
bers. Underlines m ay be inserted within numbers to improve their readability.