Expressions in Rexx are a general mechanism for combining one or more pieces of data in various ways to produce a result, usually different from the original data. All expressions evaluate to objects.
Everything in Rexx is an object.
Rexx provides some objects, which are described in later sections. You can also define and create objects that are useful in particular applications—for example, a menu object for user interaction. See
Section 1.3, “Modeling Objects” for more information.
1.11.1. Terms and Expressions
Terms are literal strings, symbols, message terms, function calls, or subexpressions interspersed with zero or more operators that denote operations to be carried out on terms.
Literal strings, which are delimited by quotation marks, are constants.
Symbols (no quotation marks) are translated to uppercase. A symbol that does not begin with a digit or a period can be the name of a variable; in this case the
value of that variable is used. A symbol that begins with a period can identify an object that the current environment provides; in this case, that object is used. Otherwise a symbol is treated as a constant string. A symbol can also be
compound.
+-,--------------+
V |
>>-symbolorstring(----+------------+-+--)----------------------><
+-expression-+
The symbolorstring is a symbol or literal string.
An
expression consists of one or more terms. A
subexpression is a term in an expression surrounded with a left and a right parenthesis.
As each term is used in an expression, it is evaluated as appropriate. The result is an object. Consequently, the result of evaluating any expression is itself an object
(such as a character string).