Change element

Description

Changing one element in list to another

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

Download

Program source code: change_element.pl

Listing

zastap(_, [], _, []).
zastap(X, [X|L1], Y, [Y|L2]) :- !, zastap(X, L1, Y, L2).
zastap(X, [A|L1], Y, [A|L2]) :- zastap(X, L1, Y, L2).
 
test :- zastap(malo, [lubie, malo, lodow, i, malo, smietany], duzo, L).

Comments

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