Różnice

Różnice między wybraną wersją a wersją aktualną.

Odnośnik do tego porównania

pl:prolog:pllib:select [2019/06/27 15:50]
pl:prolog:pllib:select [2019/06/27 15:50] (aktualna)
Linia 1: Linia 1:
 +====== Select ======
 +{{tag>​lists}}
 +===== Description =====
 +Selecting an element from a list
 +
 +**Source**: ​ The Art of Prolog
 +===== Download =====
 +Program source code: {{select.pl}}
 +===== Listing =====
 +<code prolog>
 +/*
 + select(X,​HasXs,​OneLessXs) :- 
 + The list OneLessXs is the result of removing one 
 + occurrence of X from the list HasXs.
 +*/
 +
 + select(X,​[X|Xs],​Xs).
 + select(X,​[Y|Ys],​[Y|Zs]) :- select(X,​Ys,​Zs).
 +
 +% Program 3.19: Selecting an element from a list
 +</​code>​
 +===== Comments =====
  
pl/prolog/pllib/select.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