Strings

The predefined set String can be regarded as equivalent to

lists of Character
and the predefined set Character can be regarded as equivalent to
{all S String | length(S) = 1}

This is, of course, a circular definition. However, it doesn't matter, so long as it is not used to formalize the semantics of a language. To do the latter, one would have to specify Character as an enumeration, typically the ASCII character set.

The circular definition does have the advantage of making it clear that character `a' and string `a' denote the same value. This seems rather more convenient than continually having to convert characters into strings and strings into characters, even if this is only done conceptually. It also has the advantage that `a' = [`a'], `ab' = [`a', `b'], and so on.



Prof Herman Venter
Mon Apr 15 13:55:08 GMT 1996