[ library(gfd) | Reference Manual | Alphabetic Index ]

get_domain_as_list(?Var, -DomainList)

List of all the elements in the GFD domain of Var
A domain variable or a number
The domain of Var as a list of elements.


If Var is a GFD domain variable, DomainList will be set to an ordered list containing each element in the domain of Var. If Var is a number, then DomainList will be set to a singleton list containing the number.

Modes and Determinism

Fail Conditions

The initial value of DomainList fails to unify with the returned value.


(5) type error
Var is neither a GFD variable or integer.


 [eclipse 9]: X :: [1..5,10], get_domain_as_list(X, D).

X = X{[1 .. 5, 10]}
D = [1, 2, 3, 4, 5, 10]

See Also

get_domain / 2, get_bounds / 3