<< Prev | - Up - | Next >> |
Up to now we have seen several values used in Oz: numbers, atoms, records, and lists. There are more values and types in Oz. A still incomplete list of values and types is the following:
A number is either an integer or a float (rational number).
An atom is a word.
A Boolean value is either true or false.
The unit is a constant value without particular meaning (a dummy).
A record is an atom or a term of the form Lab(F1:V1 ... Fn:Vn) where:
.
the label Lab is an atom, the unit, or a Boolean.
the features F1, ... , Fn are pairwise distinct atoms or integers.
the fields V1, ..., Vn are arbitrary values.
A tuple is a record with only integer features.
A list is a tuple which is either the atom nil or a tuple |(1:V 2:L) where | is an atom, V a value, and L a list. The atom | is sometimes called `cons'.
A string "hiho" is a list of ASCII characters, i.e integers between 0 and 128.
A procedure is a value.
<< Prev | - Up - | Next >> |