Append

Description

Appending two lists

Source: The Art of Prolog

Download

Program source code: append.pl

Listing

/*
	append(Xs,Ys,XsYs) :-
		XsYs is the result of concatening the lists Xs and Ys.
*/
 
	append([],Ys,Ys).
	append([X|Xs],Ys,[X|Zs]) :- append(Xs,Ys,Zs).
 
%	Program 3.15: Appending two lists

Comments

pl/prolog/pllib/append.txt · ostatnio zmienione: 2019/06/27 15:50 (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