~ chicken-core (chicken-5) 2457805b2561664cabd0dd07f9c0825e3ee60857
commit 2457805b2561664cabd0dd07f9c0825e3ee60857 Author: felix <felix@call-with-current-continuation.org> AuthorDate: Sun Jan 25 22:04:00 2015 +0100 Commit: felix <felix@call-with-current-continuation.org> CommitDate: Sun Jan 25 22:04:00 2015 +0100 csc, chicken-status, chicken-uninstall: mini-srfi-1.scm diff --git a/chicken-status.scm b/chicken-status.scm index b0b0f0cd..4b9a1e01 100644 --- a/chicken-status.scm +++ b/chicken-status.scm @@ -49,10 +49,12 @@ (filter (cut irregex-search rx <>) lst)) (define (gather-extensions patterns) - (let ((extensions (gather-all-extensions))) - (delete-duplicates - (concatenate (map (cut grep <> extensions) patterns)) - string=?))) + (let* ((extensions (gather-all-extensions)) + (pats (concatenate (map (cut grep <> extensions) patterns)))) + (let loop ((pats pats)) + (cond ((null? pats) '()) + ((member (car pats) (cdr pats)) (loop (cdr pats))) + (else (cons (car pats) (loop (cdr pats)))))))) (define (gather-eggs patterns) (define (egg-name extension) diff --git a/chicken-uninstall.scm b/chicken-uninstall.scm index b008e93b..1606785e 100644 --- a/chicken-uninstall.scm +++ b/chicken-uninstall.scm @@ -35,6 +35,8 @@ (import setup-api) (import srfi-1 posix data-structures utils ports irregex files) + (include "mini-srfi-1.scm") + (define-foreign-variable C_TARGET_LIB_HOME c-string) (define-foreign-variable C_BINARY_VERSION int) @@ -53,12 +55,13 @@ (filter (cut irregex-search rx <>) lst)) (define (gather-eggs patterns) - (let ((eggs (map pathname-file - (glob (make-pathname (repo-path) "*" "setup-info"))))) - (delete-duplicates - (concatenate - (map (cut grep <> eggs) patterns)) - string=?))) + (let* ((eggs (map pathname-file + (glob (make-pathname (repo-path) "*" "setup-info")))) + (pats (concatenate (map (cut grep <> eggs) patterns)))) + (let loop ((pats pats)) + (cond ((null? pats) '()) + ((member (car pats) (cdr pats)) (loop (cdr pats))) + (else (cons (car pats) (loop (cdr pats)))))))) (define (fini code) (print "aborted.") diff --git a/csc.scm b/csc.scm index d38cc27a..4fcb6f0f 100644 --- a/csc.scm +++ b/csc.scm @@ -29,6 +29,8 @@ (block) (uses data-structures ports srfi-1 utils files extras)) +(include "mini-srfi-1.scm") + (define-foreign-variable INSTALL_BIN_HOME c-string "C_INSTALL_BIN_HOME") (define-foreign-variable INSTALL_CC c-string "C_INSTALL_CC") (define-foreign-variable INSTALL_CXX c-string "C_INSTALL_CXX") @@ -777,7 +779,7 @@ EOF (set! link-options (append link-options (list arg))) ] [(> (string-length arg) 2) (let ([opts (cdr (string->list arg))]) - (if (null? (lset-difference char=? opts short-options)) + (if (null? (lset-difference opts short-options)) (set! rest (append (map (lambda (o) (string-append "-" (string o))) opts) rest) ) (stop "invalid option `~A'" arg) ) ) ] diff --git a/rules.make b/rules.make index 8a9942e6..66e4461a 100644 --- a/rules.make +++ b/rules.make @@ -528,7 +528,7 @@ optimizer.c: optimizer.scm mini-srfi-1.scm \ scrutinizer.c: scrutinizer.scm \ chicken.compiler.support.import.scm lfa2.c: lfa2.scm chicken.compiler.support.import.scm mini-srfi-1.scm -compiler-syntax.c: compiler-syntax.scm \ +compiler-syntax.c: compiler-syntax.scm mini-srfi-1.scm \ chicken.compiler.support.import.scm \ chicken.compiler.core.import.scm @@ -612,11 +612,11 @@ chicken-profile.c: $(SRCDIR)chicken-profile.scm $(CHICKEN) $< $(CHICKEN_PROGRAM_OPTIONS) -output-file $@ chicken-install.c: $(SRCDIR)chicken-install.scm setup-download.c setup-api.c $(CHICKEN) $< $(CHICKEN_PROGRAM_OPTIONS) -output-file $@ -chicken-uninstall.c: $(SRCDIR)chicken-uninstall.scm +chicken-uninstall.c: $(SRCDIR)chicken-uninstall.scm $(SRCDIR)mini-srfi-1.scm $(CHICKEN) $< $(CHICKEN_PROGRAM_OPTIONS) -output-file $@ -chicken-status.c: $(SRCDIR)chicken-status.scm +chicken-status.c: $(SRCDIR)chicken-status.scm $(SRCDIR)mini-srfi-1.scm $(CHICKEN) $< $(CHICKEN_PROGRAM_OPTIONS) -output-file $@ -csc.c: $(SRCDIR)csc.scm +csc.c: $(SRCDIR)csc.scm mini-srfi-1.scm $(CHICKEN) $< $(CHICKEN_PROGRAM_OPTIONS) -output-file $@ chicken-bug.c: $(SRCDIR)chicken-bug.scm $(CHICKEN) $< $(CHICKEN_PROGRAM_OPTIONS) -output-file $@Trap