home *** CD-ROM | disk | FTP | other *** search
Prolog Source | 1990-03-26 | 418 b | 21 lines |
- /*
- Copyright (c) 1986, 90 by Prolog Development Center
- */
-
- domains
- list = integer* /* or whatever type you wish to use */
-
- predicates
- write_a_list(list)
-
- clauses
- write_a_list([]). /* If the list is empty, do nothing more. */
-
- write_a_list([H|T]) :- /* Match the head to H and the tail to
- T, then... */
- write(H), nl,
- write_a_list(T).
-
- goal
- write_a_list([1, 2, 3]).