Strings

Gamma: Version 4.0
Prev | Chapter 3. Basic Data Types and Mechanisms | Next

# 3.3. Strings

A string is a sequence of characters (whose values range from 0x01 to 0xff), stored in consecutive bytes of memory, terminated by the null character \0. Unlike symbols, strings are not unique within the system. Strings are denoted by enclosing them in double quotation marks (for example: `"A string."`). A string is created by any of the string functions (particularly `string`), or by reading a string constant in the form `"A string."`.

The following types of operators can be used with strings:

- comparison (!=, ==)

  Example:

          Gamma> "cat" != "dog";
          t
          Gamma> "cat" == "dog";
          nil

- logical (!, &&, ||). Strings have the logical value of true in Gamma.

  Example:

          Gamma> "cat" && "dog" && nil;
          nil
          Gamma> "cat" || "dog" || nil;
          "cat"

However, strings are normally manipulated in Gamma using the string functions (see Strings and Buffers in the Reference Manual.)

Prev | Home | Next
Logical Types | Up | Lists and Arrays

Copyright 1995-2002 by Cogent Real-Time Systems, Inc.