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

pl/prolog/pllib/list_length.txt · ostatnio zmienione: 2017/07/17 08:08 (edycja zewnętrzna)
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0