Last element

Description

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

Download

Program source code: last_element.pl

Listing

ostatni(X, [X]).
ostatni(X, [_|X]) :- ostatni(X, Y).
 
test :- ostatni(X, [4, 3, 5, 6, 7]).

Comments

pl/prolog/pllib/last_element.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