home *** CD-ROM | disk | FTP | other *** search
Prolog Source | 1990-03-26 | 315 b | 16 lines |
- /*
- Copyright (c) 1986, 90 by Prolog Development Center
- */
-
- domains
- list = integer* /* or whatever type you want to use */
-
- predicates
- length_of(list, integer)
-
- clauses
- length_of([], 0).
- length_of([_|T], L) :- length_of(T, TailLength),
- L = TailLength + 1.
-