mes: Add delete-duplicates.
* module/srfi/srfi-1.mes (delete-duplicates): New function.
This commit is contained in:
parent
75db8bed91
commit
4dfe6e00cc
|
@ -100,4 +100,13 @@
|
||||||
|
|
||||||
(define last (compose car last-pair))
|
(define last (compose car last-pair))
|
||||||
|
|
||||||
|
(define (delete-duplicates lst . equal)
|
||||||
|
(let ((equal (and (pair? equal) (car equal))))
|
||||||
|
(let loop ((lst lst))
|
||||||
|
(if (null? lst) '()
|
||||||
|
(if (if equal (member (car lst) (cdr lst) equal)
|
||||||
|
(member (car lst) (cdr lst)))
|
||||||
|
(loop (cdr lst))
|
||||||
|
(cons (car lst) (loop (cdr lst))))))))
|
||||||
|
|
||||||
(include-from-path "srfi/srfi-1.scm")
|
(include-from-path "srfi/srfi-1.scm")
|
||||||
|
|
Loading…
Reference in a new issue