Identiﬁers
Date: 2020-10-07 18:10:00

Up | Next | Prev | PrevTail | Tail

### 2.3 Identiﬁers

Identiﬁers in REDUCE consist of one or more alphanumeric characters (i.e. alphabetic letters or decimal digits) the ﬁrst of which must be alphabetic. The maximum number of characters allowed is implementation dependent, although twenty-four is permitted in most implementations. In addition, the underscore character (_) is considered a letter if it is within an identiﬁer. For example,

a az p1 q23p a_very_long_variable

are all identiﬁers, whereas

_a

is not.

A sequence of alphanumeric characters in which the ﬁrst is a digit is interpreted as a product. For example, 2ab3c is interpreted as 2*ab3c. There is one exception to this: If the ﬁrst letter after a digit is E, the system will try to interpret that part of the sequence as a real number, which may fail in some cases. For example, 2E12 is the real number 2.0 ∗ 1012, 2e3c is 2000.0*C, and 2ebc gives an error.

Special characters, such as -, *, and blank, may be used in identiﬁers too, even as the ﬁrst character, but each must be preceded by an exclamation mark in input. For example:

light!-years d!*!*n good! morning
!$sign !5goldrings

CAUTION: Many system identiﬁers have such special characters in their names (especially * and =). If the user accidentally picks the name of one of them for his own purposes it may have catastrophic consequences for his REDUCE run. Users are therefore advised to avoid such names.

Identiﬁers are used as variables, labels and to name arrays, operators and procedures.

In graphical environments with typeset mathematics enabled, the (shared) variable FANCY_LOWER_DIGITS can be set to one of the values T, NIL or ALL to control the display of digits within identiﬁers. The default value is T. Digits in an identiﬁer are typeset as subscripts if fancy_lower_digits = all or if fancy_lower_digits = t and the digits are all at the end of the identiﬁer. For example, with the following values assigned to fancy_lower_digits, the identiﬁers ab12cd34 and abcd34 are displayed as follows:

fancy_lower_digits | ab12cd34 | abcd34
t |  |
all |  |
nil |  |

#### Restrictions

The reserved words listed in section (A may not be used as identiﬁers. No spaces may appear within an identiﬁer, and an identiﬁer may not extend over a line of text.

Up | Next | Prev | PrevTail | Front