EpilogJS
What
versus
How
 

uniquify


uniquify(expressionlist) → expressionlist

The subroutine uniquify takes an array of expressions as argument and returns a copy in which all duplicates have been removed. The items not removed occur in the same order as in the original array.

Call: uniquify(['c','b','c','b','a']) Exit: [c,b,a] Call: grindem(uniquify([read('p(b,c)'),read('p(a,b)'),read('p(a,b)')])) Exit: p(b,c) p(a,b)

uniquify runs in quadratic time. Compare to vniquify and zniquify.




Comments and complaints to genesereth@stanford.edu.