Next: Constructing Recursive Data Structures:
Up: Adding Computation Domains: CLP
Previous: Constructing Recursive Data Structures
-

- Lists:
- A nonempty list is a head followed by a tail (another list)
- Or the empty list (nil)
-

- The functor name usually associated with lists is `.'
-

- The constant name used to denote the empty list is []
-

- E.g., .(a, .(b, .(c, []))) is the list comprised by the
elements a, b, and c
-

- When some term is a list:
-
- is_list([]).
is_list(.(Head, Tail)):- is_list(Tail).
Last modification: Thu Oct 7 12:04:03 MEST 1999 <webmaster@clip.dia.fi.upm.es>