Spis treści

List length

Description

Determining the length of a list.

Source: PROLOG str. 52 Wydawnictwo PLJ Warszawa 1991 ISBN 83-85190-63-5

Download

Program source code: list_length.pl

Listing

dlugosc([], 0).
dlugosc([G|O], N) :- dlugosc(O, N1), N is N1 + 1.

Comments