Subsections

- Exercises

#
Values and modes

Two of the guiding principles of Algol 68 are the concepts of value and mode. Typically, an Algol 68 program manipulates values to produce new values, and, in the process, does useful work (such as word-processing). Values are such entities as numbers and letters, but you will see in later chapters that values can be very complicated and, indeed, can be things that you would not normally think of as a value.

A value is characterised by its mode. Every value has only one mode, and cannot change its mode. Therefore, if you have a mode change you must have a new value as well (but see chapter 8). A mode defines a set of values. The number of values in the set depends on the mode and there can be from none to potentially infinity. For example, the whole number represented by the digits 37 has mode `INT`. The symbol `INT` is called a mode indicant. You will be meeting many more mode indicants in the course of this book and they are all written in capital letters and sometimes with digits. The strict definition of a mode indicant is that it consists of a series of one or more characters which starts with a capital letter, and is continued by capital letters or digits. No intervening spaces are allowed. There is no limit to the length of a mode indicant although in practice it is rare to find mode indicants longer than 16 characters. Here are some more mode indicants which you will meet in this and later chapters:

       BOOL    CHAR    COMPL    FILE    HMEAN

Section 7.3 explains how you can define your own mode indicants. Although you can use any sequence of valid characters, meaningful mode indicants can help you to understand your programs.

## Exercises

1.1
  Is there anything wrong with the following mode indicants? Ans
  (a)
    `RealNumber`

  (b)
    `2NDINT`

  (c)
    `COMPL`

  (d)
    `UPPER CASE`

  (e)
    `ONE.TWO`

1.2
  What is the definition of a mode indicant? Ans