unique   xtlang


Defined in:  https://github.com/digego/extempore/tree/v0.8.9/libs/core/adt.xtm

Implementation

(bind-func unique:[List{!a}*,List{!a}*]*
  (lambda (lst)
    (let ((unq (list)))
      (while (not (null? lst))
        (if (null? (member (car lst) (cdr lst)))
            (set! unq (cons (car lst) unq)))
        (set! lst (cdr lst)))
      (reverse unq))))


Back to Index

Similar Entries