SECTION 3.2
53
Objects
Throughout this book, the term
number
refers to an object whose type may be
either integer or real. Wherever a real number is expected, an integer may be used
instead and is automatically converted to an equivalent real value. For example, it
is not necessary to write the number
1.0
in real format; the integer
1
is sufficient.
3.2.3 String Objects
A
string object
consists of a series of bytes—unsigned integer values in the range 0
to 255. String objects are not integer objects, but are stored in a more compact
format. The length of a string may be subject to implementation limits; see
String objects can be written in two ways:
•
As a sequence of literal characters enclosed in parentheses
( )
; see “Literal
•
As hexadecimal data enclosed in angle brackets
< >
; see “Hexadecimal Strings”
This section describes only the basic syntax for writing a string as a sequence of
bytes. Strings can be used for many purposes and can be formatted in a variety of
ways. When a string is used for a specific purpose (to represent a date, for ex-
ample), it is useful to have a standard format for that purpose (see Section 3.8.3,
string and are not separate object types. The use of a particular format is
described with the definition of the string object that uses that format.
contents of string objects.
Literal Strings
A
literal string
is written as an arbitrary number of characters enclosed in
parentheses. Any characters may appear in a string except unbalanced
parentheses and the backslash, which must be treated specially. Balanced pairs of
parentheses within a string require no special treatment.