3.2 Variable Status

The following procedures allow to inspect a variable's status.

`IsFree`

`{Value.isFree ``X`` ``?B``}`

tests whether `X` is currently free.

`IsDet`

`{Value.isDet ``X`` ``?B``}`

tests whether `X` is determined.

`IsFuture`

`{Value.isFuture ``X`` ``?B``}`

tests whether `X` is a future.

`IsFailed`

`{Value.isFailed ``X`` ``?B``}`

tests whether `X` is a failed value.

`IsKinded`

`{Value.isKinded ``X`` ``?B``}`

tests whether `X` is currently kinded, i. e., is constrained but not yet determined. For example, `foo(a:12 ...)` is kinded because it is constrained to be a record, yet its arity is not yet known. Also, a non-determined finite domain variable is kinded: its type is known to be integer, but its value is not yet determined. Similarly for finite set variables.

`status`

`{Value.status ``X`` ``?T``}`

returns status and type information on `X`. If `X` is free, the atom `free` is returned. If `X` is a future, the atom `future` is returned. If `X` is a failed value, the atom `failed` is returned. If `X` is kinded, the tuple `kinded(`Y`)` is returned, where Y is bound to either the atoms `int`, `fset` or `record`, depending on the type of `X`. If `X` is determined, the tuple `det(`Y`)` is returned, where Y is bound to the atom as returned by `{Value.type ``X``}`.

`type`

`{Value.type ``+X`` ``?A``}`

returns an atom describing the type of `X`. If `X` is of one of the standard primary types depicted in Figure 2.1 (except ``value''), then `A` is constrained to the most specific of `int`, `float`, `record`, `tuple`, `atom`, `name`, `procedure`, `cell`, `byteString`, `bitString`, `chunk`, `array`, `dictionary`, `bitArray`, `'class'`, `object`, `'lock'`, `port`, `space`, or `'thread'`. If any other atom is returned, this means that `X` is of no standard primary type, but an implementation-dependent extension.

Denys Duchier, Leif Kornstaedt and Christian Schulte
Version 1.4.0 (20080702)