% -*-LaTeX-*- % TECOSTR.LTX.5, 27-Sep-86 19:29:50, Edit by BEEBE % TECOSTR.LTX.4, 27-May-86 18:31:10, Edit by BEEBE % This is part of TECO.LTX Strings in \TECO{} in principle may contain all possible characters in the host character set, and may have any length greater than or equal to zero, limited only by available memory. This implementation of \TECO{} in \EPSILON{}'s \C{}-like language, \EEL{}, does not permit ASCII \A{NUL} in a string, since that is used as a string terminator by the language; otherwise, all character values from 1 to 255 may appear in a string. Multi-line strings are therefore permissible, and indeed, very useful. The edit buffer is viewed as a sequence of characters, and lines are distinguishable only because the editor starts a new screen line for text following a line terminator. The line terminator is implementation-dependent. In \ETECO{}, it is \A{CR}\A{LF}, but in this \TECO{}, it is \A{LF}, just like it is in \C{} and the {\sc unix} system. This is transparent when you write \TECO{} inside the editor---if the string looks like it has an embedded newline, then it does. Unlike \C{}, no special representation of certain characters with backslashed letter or octal digit sequences is supported. For example, the command \begin{verbatim} @S/foo bar/ \end{verbatim} would search for the string ``\T{foo\A{newline}bar}'' in the buffer. A string object is distinguishable from a number object by virtue of the way it is collected by the interpreter. This is not true in \ETECO{}, which interprets certain integer values as addresses of strings. In \EPSILON{}'s \EEL{} language used to implement this \TECO{}, coercion between pointers and integers is forbidden, so objects are given explicit type codes which are checked before using an object. We therefore have to decide what should be done when an attempt is made to use a string as an integer, or an integer as a string. This {\em could} be made an error, but it is more useful for it not to be. Instead, a string is coerced to an integer by applying the same rules used to collect an integer which were described in the preceding section, and an integer is coerced to a string by converting it to its decimal representation with no leading zeros, preceded by a minus sign if it is negative.