Pattern wtext represents 16-bit UniCode texts. For details see the library basiclib/wtext.bet. Operations supporting conversion between text and wtext are available. In a future version of BETA, wtext may replace text.
The pattern Text enters and exits a char-repetition. This means, that a text may be initialized using constant strings as follows:
t: @text; do 'hello' -> t;
Many operations involving texts, however, takes references to texts as enter/exit parameters. This is mainly for efficiency reasons.
To allow easy invocation of such operations on string literals, the following is also allowed:
t: ^text; do 'hello' -> t[];
The semantics of this is, that a text object is instantiated, initialized by the constant string, and finally assigned to the text reference. It thus corresponds to the following code:
do &text[] -> t[]; 'hello' -> t
The following special characters are allowed in BETA string literals.
\ooo can also be \o or \oo, if the character immediately following \o or \oo respectively, is not a digit.
Previous versions of BETA has allowed '' to represent a quote ' in strings as in 'Tom''s Cottage'. This is no longer allowed. Quote must be represented using \' as in:
'Tom\'s Cottage'
This corresponds to:
'Lisa Nelson, ' '2454 West Street, ' 'Palo Alto, CA 94304' -> T[]
'Lisa Nelson, 2454 West Street, Palo Alto, CA 94304' -> T[]
Q: [1]@char
The evaluation:
may considered as an abbreviation for:
'Hello' -> Q
('H','e','l','l','o') -> Q
BETA Language Modifications - Reference Manual | © 1999-2002 Mjølner Informatics |
[Modified: Sunday October 22nd 2000 at 0:53]
|