Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to conc a unknown number of lists

Status
Not open for further replies.

Cantona7

MIS
Apr 29, 2003
4
US
how can i cocatenation an unnown number os lists?
 
cat([], Y, Y).
cat([X|XR], Y, [X|Z]) :- cat(XR, Y, Z).


?- cat([a], [], X).
X = [a] ;
no

?- cat([], [a], X).
X = [a] ;
no

?- cat([a, b], [c, d, e], X).
X = [a,b,c,d,e] ;
no
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top