/usr/lib/s9fes/list-to-set.scm is in scheme9 2010.11.13-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | ; Scheme 9 from Empty Space, Function Library
; By Nils M Holm, 2009
; See the LICENSE file of the S9fES package for terms of use
;
; (list->set list) ==> list
;
; (load-from-library "list-to-set.scm")
;
; Convert list to set. A set is a list containing unique members.
;
; Example: (list->set '(a b c b c)) ==> (a b c)
(define (list->set a)
(letrec
((list->set2
(lambda (a r)
(cond ((null? a)
(reverse! r))
((member (car a) r)
(list->set2 (cdr a) r))
(else
(list->set2 (cdr a)
(cons (car a) r)))))))
(list->set2 a '())))
|