diff options
| author | 2021-08-26 00:12:45 +0300 | |
|---|---|---|
| committer | 2021-08-26 00:12:45 +0300 | |
| commit | 470b87e3f54d3523d722cf3738d99a8307edd466 (patch) | |
| tree | 37379026929e274972670f6f36b77bdfa2041a87 | |
| parent | remove old file (diff) | |
add kawa docker test
| -rw-r--r-- | Dockerfile | 37 | ||||
| -rw-r--r-- | docker-chibi.sh | 7 | ||||
| -rw-r--r-- | docker-compose.yml | 16 | ||||
| -rw-r--r-- | docker-kawa.sh | 23 | ||||
| -rw-r--r-- | srfi-225-test.scm | 20 | ||||
| -rw-r--r-- | srfi/225.sld | 6 | ||||
| -rw-r--r-- | srfi/srfi-125-impl.scm | 183 | ||||
| -rw-r--r-- | srfi/srfi-126-impl.scm | 142 | ||||
| -rw-r--r-- | srfi/srfi-69-impl.scm | 106 |
9 files changed, 302 insertions, 238 deletions
@@ -2,10 +2,47 @@ FROM alpine RUN apk add --no-cache git RUN mkdir /dependencies WORKDIR /dependencies + +RUN mkdir /dependencies/srfi-27/srfi/ -p +RUN echo "\ +(define-library (srfi 27)\ + (import (scheme base))\ + (export random-integer)\ + (begin\ + (define (random-integer arg) arg)))\ +" > /dependencies/srfi-27/srfi/27.sld + RUN ["git", "clone", "https://github.com/scheme-requests-for-implementation/srfi-69/"] RUN ["git", "clone", "https://github.com/scheme-requests-for-implementation/srfi-125/"] RUN ["git", "clone", "https://github.com/scheme-requests-for-implementation/srfi-126/"] +RUN ["git", "clone", "https://github.com/scheme-requests-for-implementation/srfi-128/"] + +RUN ["git", "clone", "https://github.com/scheme-requests-for-implementation/srfi-143/"] +RUN sed -i 's/(srfi-143)/(srfi 143)/g' /dependencies/srfi-143/srfi-143/srfi-143.sld + RUN ["git", "clone", "https://github.com/scheme-requests-for-implementation/srfi-146/"] + +RUN mkdir /dependencies/srfi-145/srfi/ -p +RUN echo "\ +(define-library (srfi 145)\ + (import (scheme base))\ + (export assume)\ + (begin\ + (define-syntax assume\ + (syntax-rules ()\ + ((assume expression message ...)\ + (or expression\ + (error \"invalid assumption\" (quote expression) (list message ...))))\ + ((assume . _)\ + (syntax-error \"invalid assume syntax\"))))))\ +" > /dependencies/srfi-145/srfi/145.sld + +RUN ["git", "clone", "https://github.com/scheme-requests-for-implementation/srfi-151/"] +RUN sed -i 's/(srfi-151)/(srfi 151)/g' /dependencies/srfi-151/srfi-151/srfi-151.sld + +RUN ["git", "clone", "https://github.com/scheme-requests-for-implementation/srfi-158/"] +RUN sed -i 's/(srfi-158)/(srfi 158)/g' /dependencies/srfi-158/srfi-158.sld + RUN ["wget", "https://snow-fort.org/s/ccs.neu.edu/will/r6rs/enums/0.0.1/r6rs-enums-0.0.1.tgz"] RUN ["tar", "-xf", "r6rs-enums-0.0.1.tgz"] RUN ["wget", "https://snow-fort.org/s/ccs.neu.edu/will/r6rs/lists/0.0.1/r6rs-lists-0.0.1.tgz"] diff --git a/docker-chibi.sh b/docker-chibi.sh new file mode 100644 index 0000000..1445bbc --- /dev/null +++ b/docker-chibi.sh @@ -0,0 +1,7 @@ +chibi-scheme\ + -I /test/srfi-225\ + -I /dependencies/srfi-126\ + -I /dependencies/r6rs-enums-0.0.1\ + -I /dependencies/r6rs-lists-0.0.1\ + -I /dependencies/r6rs-sorting-0.0.1\ + /test/srfi-225/srfi-225-test.scm diff --git a/docker-compose.yml b/docker-compose.yml index da47b23..de354b9 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -10,13 +10,16 @@ services: - srfi_225_test volumes: - dependencies-volume:/dependencies - gauche: - image: "schemers/gauche" + kawa: + image: "schemers/kawa" depends_on: - srfi_225_test volumes: - dependencies-volume:/dependencies - command: ["gosh", "-I", "/dependencies/srfi-225", "/dependencies/srfi-225/srfi-225-dependencies.scm"] + - type: bind + source: . + target: /test/srfi-225 + command: "sh /test/srfi-225/docker-kawa.sh" chibi: image: "schemers/chibi" depends_on: @@ -26,12 +29,7 @@ services: - type: bind source: . target: /test/srfi-225 - command: ["chibi-scheme", "-I", "/test/srfi-225", - "-I", "/dependencies/srfi-126", - "-I", "/dependencies/r6rs-enums-0.0.1", - "-I", "/dependencies/r6rs-lists-0.0.1", - "-I", "/dependencies/r6rs-sorting-0.0.1", - "/test/srfi-225/srfi-225-test.scm"] + command: "sh /test/srfi-225/docker-chibi.sh" volumes: dependencies-volume: diff --git a/docker-kawa.sh b/docker-kawa.sh new file mode 100644 index 0000000..64de401 --- /dev/null +++ b/docker-kawa.sh @@ -0,0 +1,23 @@ +mkdir /target + +for i in\ + "srfi-27/srfi/27"\ + "r6rs-lists-0.0.1/r6rs/lists"\ + "r6rs-sorting-0.0.1/r6rs/sorting"\ + "r6rs-enums-0.0.1/r6rs/enums"\ + "srfi-126/r6rs/hashtables"\ + "srfi-126/srfi/126"\ + "srfi-128/srfi/128"\ + "srfi-125/srfi/125"\ + "srfi-143/srfi-143/srfi-143"\ + "srfi-145/srfi/145"\ + "srfi-158/srfi-158"\ + "srfi-151/srfi-151/srfi-151"\ + "srfi-146/srfi/146"\ + "srfi-146/srfi/146/hash" +do + CLASSPATH=target kawa -d target -C "dependencies/$i.sld" +done + +CLASSPATH=target kawa --r7rs -d target -C "test/srfi-225/srfi/225.sld" +CLASSPATH=target kawa --r7rs "test/srfi-225/srfi-225-test.scm" diff --git a/srfi-225-test.scm b/srfi-225-test.scm index b85297c..746cfd5 100644 --- a/srfi-225-test.scm +++ b/srfi-225-test.scm @@ -2,9 +2,9 @@ (scheme case-lambda) (scheme write) (srfi 1) - (prefix (srfi 69) t69:) - (prefix (srfi 125) t125:) - (prefix (srfi 126) t126:) + (prefix (srfi 69) t69-) + (prefix (srfi 125) t125-) + (prefix (srfi 126) t126-) (srfi 128) (srfi 146) (srfi 146 hash) @@ -42,8 +42,6 @@ (define (do-test real-dtd alist->dict comparator) - (define dtd real-dtd) - (define-values (dtd counter) (wrap-dtd real-dtd)) @@ -679,10 +677,10 @@ (do-test srfi-69-dtd (lambda (alist) - (define table (t69:make-hash-table equal?)) + (define table (t69-make-hash-table equal?)) (for-each (lambda (pair) - (t69:hash-table-set! table (car pair) (cdr pair))) + (t69-hash-table-set! table (car pair) (cdr pair))) alist) table) (make-default-comparator))) @@ -692,10 +690,10 @@ (do-test hash-table-dtd (lambda (alist) - (define table (t125:make-hash-table equal?)) + (define table (t125-hash-table-empty-copy (t125-make-hash-table equal?))) (for-each (lambda (pair) - (t125:hash-table-set! table (car pair) (cdr pair))) + (t125-hash-table-set! table (car pair) (cdr pair))) alist) table) (make-default-comparator))) @@ -705,10 +703,10 @@ (do-test srfi-126-dtd (lambda (alist) - (define table (t126:make-eqv-hashtable)) + (define table (t126-make-eqv-hashtable)) (for-each (lambda (pair) - (t126:hashtable-set! table (car pair) (cdr pair))) + (t126-hashtable-set! table (car pair) (cdr pair))) alist) table) (make-default-comparator))) diff --git a/srfi/225.sld b/srfi/225.sld index f44f3ab..17358c4 100644 --- a/srfi/225.sld +++ b/srfi/225.sld @@ -153,21 +153,21 @@ (cond-expand ((library (srfi 69)) - (import (prefix (srfi 69) t69:)) + (import (prefix (srfi 69) t69-)) (include "srfi-69-impl.scm") (export srfi-69-dtd)) (else)) (cond-expand ((library (srfi 125)) - (import (prefix (srfi 125) t125:)) + (import (prefix (srfi 125) t125-)) (include "srfi-125-impl.scm") (export hash-table-dtd)) (else)) (cond-expand ((library (srfi 126)) - (import (prefix (srfi 126) t126:)) + (import (prefix (srfi 126) t126-)) (include "srfi-126-impl.scm") (export srfi-126-dtd)) (else)) diff --git a/srfi/srfi-125-impl.scm b/srfi/srfi-125-impl.scm index d735f95..f594f6b 100644 --- a/srfi/srfi-125-impl.scm +++ b/srfi/srfi-125-impl.scm @@ -1,160 +1,161 @@ (define hash-table-dtd (let () - (define (t125:make-hash-table* dtd comparator) - (t125:hash-table comparator)) + (define (t125-make-hash-table* dtd comparator) + ;; make mutable table + (t125-hash-table-empty-copy (t125-hash-table comparator))) - (define (t125:hash-table-set!* dtd table . obj) - (apply t125:hash-table-set! (cons table obj)) + (define (t125-hash-table-set!* dtd table . obj) + (apply t125-hash-table-set! (cons table obj)) table) - (define (t125:hash-table-update!* dtd table key updater fail success) - (t125:hash-table-update! table key updater fail success) + (define (t125-hash-table-update!* dtd table key updater fail success) + (t125-hash-table-update! table key updater fail success) table) - (define (t125:hash-table-update!/default* dtd table key proc default) - (t125:hash-table-update!/default table key proc default) + (define (t125-hash-table-update!/default* dtd table key proc default) + (t125-hash-table-update!/default table key proc default) table) - (define (t125:hash-table-intern!* dtd table key failure) - (define val (t125:hash-table-intern! table key failure)) + (define (t125-hash-table-intern!* dtd table key failure) + (define val (t125-hash-table-intern! table key failure)) (values table val)) - (define (t125:hash-table-pop!* dtd table) - (if (t125:hash-table-empty? table) + (define (t125-hash-table-pop!* dtd table) + (if (t125-hash-table-empty? table) (error "popped empty dictionary") (call-with-values - (lambda () (t125:hash-table-pop! table)) + (lambda () (t125-hash-table-pop! table)) (lambda (key value) (values table key value))))) - (define (t125:hash-table-delete-all!* dtd table keys) + (define (t125-hash-table-delete-all!* dtd table keys) (for-each (lambda (key) - (t125:hash-table-delete! table key)) + (t125-hash-table-delete! table key)) keys) table) - (define (t125:hash-table-map!* dtd proc table) - (t125:hash-table-map! proc table) + (define (t125-hash-table-map!* dtd proc table) + (t125-hash-table-map! proc table) table) - (define (t125:hash-table-filter!* dtd proc table) - (t125:hash-table-prune! + (define (t125-hash-table-filter!* dtd proc table) + (t125-hash-table-prune! (lambda (key value) (not (proc key value))) table) table) - (define (t125:hash-table-filter* dtd proc table) + (define (t125-hash-table-filter* dtd proc table) (dict-filter! dtd proc (dict-copy dtd table))) - (define (t125:hash-table-remove!* dtd proc table) - (t125:hash-table-prune! proc table) + (define (t125-hash-table-remove!* dtd proc table) + (t125-hash-table-prune! proc table) table) - (define (t125:hash-table-remove* dtd proc table) + (define (t125-hash-table-remove* dtd proc table) (dict-remove! dtd proc (dict-copy dtd table))) - (define (t125:hash-table-search!* dtd table key fail success) + (define (t125-hash-table-search!* dtd table key fail success) (define (handle-success value) (define (update new-key new-value obj) (unless (eq? new-key key) - (t125:hash-table-delete! table key)) - (t125:hash-table-set! table new-key new-value) + (t125-hash-table-delete! table key)) + (t125-hash-table-set! table new-key new-value) (values table obj)) (define (remove obj) - (t125:hash-table-delete! table key) + (t125-hash-table-delete! table key) (values table obj)) (success key value update remove)) (define (handle-fail) (define (ignore obj) (values table obj)) (define (insert value obj) - (t125:hash-table-set! table key value) + (t125-hash-table-set! table key value) (values table obj)) (fail insert ignore)) (define default (cons #f #f)) - (t125:hash-table-ref table key handle-fail handle-success)) + (t125-hash-table-ref table key handle-fail handle-success)) - (define (t125:hash-table-search* dtd table key fail success) - (t125:hash-table-search!* dtd (dict-copy dtd table) key fail success)) + (define (t125-hash-table-search* dtd table key fail success) + (t125-hash-table-search!* dtd (dict-copy dtd table) key fail success)) - (define (t125:hash-table-comparator* dtd table) + (define (t125-hash-table-comparator* dtd table) (make-comparator (lambda args #t) - (t125:hash-table-equivalence-function table) + (t125-hash-table-equivalence-function table) #f - (t125:hash-table-hash-function table))) + (t125-hash-table-hash-function table))) - (define (t125:hash-table-copy* dtd table) - (t125:hash-table-copy table)) + (define (t125-hash-table-copy* dtd table) + (t125-hash-table-copy table #t)) - (define (t125:hash-table-size* dtd table) - (t125:hash-table-size table)) + (define (t125-hash-table-size* dtd table) + (t125-hash-table-size table)) - (define (t125:hash-table-for-each* dtd proc table) - (t125:hash-table-for-each proc table)) + (define (t125-hash-table-for-each* dtd proc table) + (t125-hash-table-for-each proc table)) - (define (t125:hash-table-keys* dtd table) - (t125:hash-table-keys table)) + (define (t125-hash-table-keys* dtd table) + (t125-hash-table-keys table)) - (define (t125:hash-table-values* dtd table) - (t125:hash-table-values table)) + (define (t125-hash-table-values* dtd table) + (t125-hash-table-values table)) - (define (t125:hash-table-entries* dtd table) - (t125:hash-table-entries table)) + (define (t125-hash-table-entries* dtd table) + (t125-hash-table-entries table)) - (define (t125:hash-table-fold* dtd proc knil table) - (t125:hash-table-fold proc knil table)) + (define (t125-hash-table-fold* dtd proc knil table) + (t125-hash-table-fold proc knil table)) - (define (t125:hash-table-map->list* dtd proc table) - (t125:hash-table-map->list proc table)) + (define (t125-hash-table-map->list* dtd proc table) + (t125-hash-table-map->list proc table)) - (define (t125:hash-table->alist* dtd table) - (t125:hash-table->alist table)) + (define (t125-hash-table->alist* dtd table) + (t125-hash-table->alist table)) - (define (t125:hash-table?* dtd table) - (t125:hash-table? table)) + (define (t125-hash-table?* dtd table) + (t125-hash-table? table)) - (define (t125:hash-table-empty?* dtd table) - (t125:hash-table-empty? table)) + (define (t125-hash-table-empty?* dtd table) + (t125-hash-table-empty? table)) - (define (t125:hash-table-contains?* dtd table key) - (t125:hash-table-contains? table key)) + (define (t125-hash-table-contains?* dtd table key) + (t125-hash-table-contains? table key)) - (define (t125:hash-table-ref* dtd table key failure success) - (t125:hash-table-ref table key failure success)) + (define (t125-hash-table-ref* dtd table key failure success) + (t125-hash-table-ref table key failure success)) - (define (t125:hash-table-ref/default* dtd table key default) - (t125:hash-table-ref/default table key default)) + (define (t125-hash-table-ref/default* dtd table key default) + (t125-hash-table-ref/default table key default)) (make-dtd - make-dictionary-id t125:make-hash-table* - dictionary?-id t125:hash-table?* - dict-empty?-id t125:hash-table-empty?* - dict-contains?-id t125:hash-table-contains?* - dict-ref-id t125:hash-table-ref* - dict-ref/default-id t125:hash-table-ref/default* - dict-set!-id t125:hash-table-set!* - dict-delete-all!-id t125:hash-table-delete-all!* - dict-intern!-id t125:hash-table-intern!* - dict-update!-id t125:hash-table-update!* - dict-update/default!-id t125:hash-table-update!/default* - dict-pop!-id t125:hash-table-pop!* - dict-map!-id t125:hash-table-map!* - dict-filter!-id t125:hash-table-filter!* - dict-filter-id t125:hash-table-filter* - dict-remove!-id t125:hash-table-remove!* - dict-remove-id t125:hash-table-remove* - dict-search!-id t125:hash-table-search!* - dict-search-id t125:hash-table-search* - dict-size-id t125:hash-table-size* - dict-for-each-id t125:hash-table-for-each* - dict-keys-id t125:hash-table-keys* - dict-values-id t125:hash-table-values* - dict-entries-id t125:hash-table-entries* - dict-fold-id t125:hash-table-fold* - dict-map->list-id t125:hash-table-map->list* - dict->alist-id t125:hash-table->alist* - dict-comparator-id t125:hash-table-comparator* - dict-copy-id t125:hash-table-copy*))) + make-dictionary-id t125-make-hash-table* + dictionary?-id t125-hash-table?* + dict-empty?-id t125-hash-table-empty?* + dict-contains?-id t125-hash-table-contains?* + dict-ref-id t125-hash-table-ref* + dict-ref/default-id t125-hash-table-ref/default* + dict-set!-id t125-hash-table-set!* + dict-delete-all!-id t125-hash-table-delete-all!* + dict-intern!-id t125-hash-table-intern!* + dict-update!-id t125-hash-table-update!* + dict-update/default!-id t125-hash-table-update!/default* + dict-pop!-id t125-hash-table-pop!* + dict-map!-id t125-hash-table-map!* + dict-filter!-id t125-hash-table-filter!* + dict-filter-id t125-hash-table-filter* + dict-remove!-id t125-hash-table-remove!* + dict-remove-id t125-hash-table-remove* + dict-search!-id t125-hash-table-search!* + dict-search-id t125-hash-table-search* + dict-size-id t125-hash-table-size* + dict-for-each-id t125-hash-table-for-each* + dict-keys-id t125-hash-table-keys* + dict-values-id t125-hash-table-values* + dict-entries-id t125-hash-table-entries* + dict-fold-id t125-hash-table-fold* + dict-map->list-id t125-hash-table-map->list* + dict->alist-id t125-hash-table->alist* + dict-comparator-id t125-hash-table-comparator* + dict-copy-id t125-hash-table-copy*))) diff --git a/srfi/srfi-126-impl.scm b/srfi/srfi-126-impl.scm index 5e308ba..43dd9b5 100644 --- a/srfi/srfi-126-impl.scm +++ b/srfi/srfi-126-impl.scm @@ -5,148 +5,148 @@ (lambda (dtd . args) (apply proc args))) - (define (t126:make-hashtable* dtd comparator) - (t126:make-hashtable (comparator-hash-function comparator) + (define (t126-make-hashtable* dtd comparator) + (t126-make-hashtable (comparator-hash-function comparator) (comparator-equality-predicate comparator))) - (define (t126:hashtable-ref* dtd table key fail success) - (define-values (value found?) (t126:hashtable-lookup table key)) + (define (t126-hashtable-ref* dtd table key fail success) + (define-values (value found?) (t126-hashtable-lookup table key)) (if found? (success value) (fail))) - (define (t126:hashtable-ref/default* dtd table key default) - (t126:hashtable-ref table key default)) + (define (t126-hashtable-ref/default* dtd table key default) + (t126-hashtable-ref table key default)) - (define (t126:hashtable-set!* dtd table . obj) + (define (t126-hashtable-set!* dtd table . obj) (let loop ((obj obj)) (if (null? obj) table (begin - (t126:hashtable-set! table (car obj) (cadr obj)) + (t126-hashtable-set! table (car obj) (cadr obj)) (loop (cddr obj)))))) - (define (t126:hashtable-delete-all!* dtd table keys) + (define (t126-hashtable-delete-all!* dtd table keys) (for-each (lambda (key) - (t126:hashtable-delete! table key)) + (t126-hashtable-delete! table key)) keys) table) - (define (t126:hashtable-intern!* dtd table key default) - (define val (t126:hashtable-intern! table key default)) + (define (t126-hashtable-intern!* dtd table key default) + (define val (t126-hashtable-intern! table key default)) (values table val)) - (define (t126:hashtable-update/default!* dtd table key updater default) - (t126:hashtable-update! table key updater default) + (define (t126-hashtable-update/default!* dtd table key updater default) + (t126-hashtable-update! table key updater default) table) - (define (t126:hashtable-pop!* dtd table) - (if (t126:hashtable-empty? table) + (define (t126-hashtable-pop!* dtd table) + (if (t126-hashtable-empty? table) (error "popped empty dictionary") (call-with-values - (lambda () (t126:hashtable-pop! table)) + (lambda () (t126-hashtable-pop! table)) (lambda (key value) (values table key value))))) - (define (t126:hashtable-update-all!* dtd proc table) - (t126:hashtable-update-all! table proc) + (define (t126-hashtable-update-all!* dtd proc table) + (t126-hashtable-update-all! table proc) table) - (define (t126:hashtable-filter!* dtd proc table) - (t126:hashtable-prune! table + (define (t126-hashtable-filter!* dtd proc table) + (t126-hashtable-prune! table (lambda (key value) (not (proc key value)))) table) - (define (t126:hashtable-filter* dtd proc table) + (define (t126-hashtable-filter* dtd proc table) (dict-filter! dtd proc (dict-copy dtd table))) - (define (t126:hashtable-remove!* dtd proc table) - (t126:hashtable-prune! table proc) + (define (t126-hashtable-remove!* dtd proc table) + (t126-hashtable-prune! table proc) table) - (define (t126:hashtable-remove* dtd proc table) + (define (t126-hashtable-remove* dtd proc table) (dict-remove! dtd proc (dict-copy dtd table))) - (define (t126:hashtable-search!* dtd table key fail success) + (define (t126-hashtable-search!* dtd table key fail success) (define (handle-success value) (define (update new-key new-value obj) (unless (eq? new-key key) - (t126:hashtable-delete! table key)) - (t126:hashtable-set! table new-key new-value) + (t126-hashtable-delete! table key)) + (t126-hashtable-set! table new-key new-value) (values table obj)) (define (remove obj) - (t126:hashtable-delete! table key) + (t126-hashtable-delete! table key) (values table obj)) (success key value update remove)) (define (handle-fail) (define (ignore obj) (values table obj)) (define (insert value obj) - (t126:hashtable-set! table key value) + (t126-hashtable-set! table key value) (values table obj)) (fail insert ignore)) (define default (cons #f #f)) - (define found (t126:hashtable-ref table key default)) + (define found (t126-hashtable-ref table key default)) (if (eq? default found) (handle-fail) (handle-success found))) - (define (t126:hashtable-search* dtd table key fail success) + (define (t126-hashtable-search* dtd table key fail success) (dict-search! dtd (dict-copy dtd table) key fail success)) - (define (t126:hashtable-for-each* dtd proc table) - (t126:hashtable-walk table proc) + (define (t126-hashtable-for-each* dtd proc table) + (t126-hashtable-walk table proc) table) - (define (t126:hashtable-map->lset* dtd proc table) - (t126:hashtable-map->lset table proc)) + (define (t126-hashtable-map->lset* dtd proc table) + (t126-hashtable-map->lset table proc)) - (define (t126:hashtable-keys* dtd table) - (vector->list (t126:hashtable-keys table))) + (define (t126-hashtable-keys* dtd table) + (vector->list (t126-hashtable-keys table))) - (define (t126:hashtable-values* dtd table) - (vector->list (t126:hashtable-values table))) + (define (t126-hashtable-values* dtd table) + (vector->list (t126-hashtable-values table))) - (define (t126:hashtable-entries* dtd table) + (define (t126-hashtable-entries* dtd table) (call-with-values - (lambda () (t126:hashtable-entries table)) + (lambda () (t126-hashtable-entries table)) (lambda (keys vals) (values (vector->list keys) (vector->list vals))))) - (define (t126:hashtable-copy* dtd table) - (t126:hashtable-copy table #t)) + (define (t126-hashtable-copy* dtd table) + (t126-hashtable-copy table #t)) - (define (t126:hashtable-comparator* dtd table) + (define (t126-hashtable-comparator* dtd table) #f) (make-dtd - make-dictionary-id t126:make-hashtable* - dictionary?-id (prep-dtd-arg t126:hashtable?) - dict-empty?-id (prep-dtd-arg t126:hashtable-empty?) - dict-contains?-id (prep-dtd-arg t126:hashtable-contains?) - dict-ref-id t126:hashtable-ref* - dict-ref/default-id t126:hashtable-ref/default* - dict-set!-id t126:hashtable-set!* - dict-delete-all!-id t126:hashtable-delete-all!* - dict-intern!-id t126:hashtable-intern!* - dict-update/default!-id t126:hashtable-update/default!* - dict-pop!-id t126:hashtable-pop!* - dict-map!-id t126:hashtable-update-all!* - dict-filter!-id t126:hashtable-filter!* - dict-filter-id t126:hashtable-filter* - dict-remove!-id t126:hashtable-remove!* - dict-remove-id t126:hashtable-remove* - dict-search!-id t126:hashtable-search!* - dict-search-id t126:hashtable-search* - dict-size-id (prep-dtd-arg t126:hashtable-size) - dict-for-each-id t126:hashtable-for-each* - dict-keys-id t126:hashtable-keys* - dict-values-id t126:hashtable-values* - dict-entries-id t126:hashtable-entries* - dict-map->list-id t126:hashtable-map->lset* - dict-copy-id t126:hashtable-copy* - dict-comparator-id t126:hashtable-comparator*))) + make-dictionary-id t126-make-hashtable* + dictionary?-id (prep-dtd-arg t126-hashtable?) + dict-empty?-id (prep-dtd-arg t126-hashtable-empty?) + dict-contains?-id (prep-dtd-arg t126-hashtable-contains?) + dict-ref-id t126-hashtable-ref* + dict-ref/default-id t126-hashtable-ref/default* + dict-set!-id t126-hashtable-set!* + dict-delete-all!-id t126-hashtable-delete-all!* + dict-intern!-id t126-hashtable-intern!* + dict-update/default!-id t126-hashtable-update/default!* + dict-pop!-id t126-hashtable-pop!* + dict-map!-id t126-hashtable-update-all!* + dict-filter!-id t126-hashtable-filter!* + dict-filter-id t126-hashtable-filter* + dict-remove!-id t126-hashtable-remove!* + dict-remove-id t126-hashtable-remove* + dict-search!-id t126-hashtable-search!* + dict-search-id t126-hashtable-search* + dict-size-id (prep-dtd-arg t126-hashtable-size) + dict-for-each-id t126-hashtable-for-each* + dict-keys-id t126-hashtable-keys* + dict-values-id t126-hashtable-values* + dict-entries-id t126-hashtable-entries* + dict-map->list-id t126-hashtable-map->lset* + dict-copy-id t126-hashtable-copy* + dict-comparator-id t126-hashtable-comparator*))) diff --git a/srfi/srfi-69-impl.scm b/srfi/srfi-69-impl.scm index ee619e0..90c3b97 100644 --- a/srfi/srfi-69-impl.scm +++ b/srfi/srfi-69-impl.scm @@ -5,7 +5,7 @@ (lambda (dtd . args) (apply proc args))) - (define (t69:make-hash-table* dtd comparator) + (define (t69-make-hash-table* dtd comparator) (define constructor-args (if (not comparator) '() @@ -14,109 +14,109 @@ (if hash (list pred hash) (list pred))))) - (apply t69:make-hash-table constructor-args)) + (apply t69-make-hash-table constructor-args)) - (define (t69:hash-table-ref* dtd table key fail success) + (define (t69-hash-table-ref* dtd table key fail success) (define default (cons #f #f)) - (define found (t69:hash-table-ref/default table key default)) + (define found (t69-hash-table-ref/default table key default)) (if (eq? found default) (fail) (success found))) - (define (t69:hash-table-set!* dtd table . obj) + (define (t69-hash-table-set!* dtd table . obj) (let loop ((obj obj)) (if (null? obj) table (begin - (t69:hash-table-set! table (car obj) (cadr obj)) + (t69-hash-table-set! table (car obj) (cadr obj)) (loop (cddr obj)))))) - (define (t69:hash-table-update!/default* dtd table key proc default) - (t69:hash-table-update!/default table key proc default) + (define (t69-hash-table-update!/default* dtd table key proc default) + (t69-hash-table-update!/default table key proc default) table) - (define (t69:hash-table-delete-all!* dtd table keys) + (define (t69-hash-table-delete-all!* dtd table keys) (for-each (lambda (key) - (t69:hash-table-delete! table key)) + (t69-hash-table-delete! table key)) keys) table) - (define (t69:hash-table-foreach* dtd proc table) - (t69:hash-table-walk table proc)) + (define (t69-hash-table-foreach* dtd proc table) + (t69-hash-table-walk table proc)) - (define (t69:hash-table-map!* dtd proc table) - (t69:hash-table-walk table (lambda (key value) - (t69:hash-table-set! table key (proc key value)))) + (define (t69-hash-table-map!* dtd proc table) + (t69-hash-table-walk table (lambda (key value) + (t69-hash-table-set! table key (proc key value)))) table) - (define (t69:hash-table-filter!* dtd proc table) - (t69:hash-table-walk table + (define (t69-hash-table-filter!* dtd proc table) + (t69-hash-table-walk table (lambda (key value) (unless (proc key value) - (t69:hash-table-delete! table key)))) + (t69-hash-table-delete! table key)))) table) - (define (t69:hash-table-filter* dtd proc table) + (define (t69-hash-table-filter* dtd proc table) (dict-filter! dtd proc (dict-copy dtd table))) - (define (t69:hash-table-fold* dtd proc knil table) - (t69:hash-table-fold table proc knil)) + (define (t69-hash-table-fold* dtd proc knil table) + (t69-hash-table-fold table proc knil)) - (define (t69:hash-table-search!* dtd table key fail success) + (define (t69-hash-table-search!* dtd table key fail success) (define (handle-success value) (define (update new-key new-value obj) (unless (eq? new-key key) - (t69:hash-table-delete! table key)) - (t69:hash-table-set! table new-key new-value) + (t69-hash-table-delete! table key)) + (t69-hash-table-set! table new-key new-value) (values table obj)) (define (remove obj) - (t69:hash-table-delete! table key) + (t69-hash-table-delete! table key) (values table obj)) (success key value update remove)) (define (handle-fail) (define (ignore obj) (values table obj)) (define (insert value obj) - (t69:hash-table-set! table key value) + (t69-hash-table-set! table key value) (values table obj)) (fail insert ignore)) (define default (cons #f #f)) - (define found (t69:hash-table-ref/default table key default)) + (define found (t69-hash-table-ref/default table key default)) (if (eq? default found) (handle-fail) (handle-success found))) - (define (t69:hash-table-search* dtd table key fail success) - (t69:hash-table-search!* dtd (dict-copy dtd table) key fail success)) + (define (t69-hash-table-search* dtd table key fail success) + (t69-hash-table-search!* dtd (dict-copy dtd table) key fail success)) - (define (t69:hash-table-comparator* dtd table) + (define (t69-hash-table-comparator* dtd table) (make-comparator (lambda args #t) - (or (t69:hash-table-equivalence-function table) + (or (t69-hash-table-equivalence-function table) equal?) #f - (t69:hash-table-hash-function table))) + (t69-hash-table-hash-function table))) (make-dtd - make-dictionary-id t69:make-hash-table* - dictionary?-id (prep-dtd-arg t69:hash-table?) - dict-ref-id t69:hash-table-ref* - dict-ref/default-id (prep-dtd-arg t69:hash-table-ref/default) - dict-set!-id t69:hash-table-set!* - dict-delete-all!-id t69:hash-table-delete-all!* - dict-contains?-id (prep-dtd-arg t69:hash-table-exists?) - dict-update/default!-id t69:hash-table-update!/default* - dict-size-id (prep-dtd-arg t69:hash-table-size) - dict-keys-id (prep-dtd-arg t69:hash-table-keys) - dict-values-id (prep-dtd-arg t69:hash-table-values) - dict-map!-id t69:hash-table-map!* - dict-filter!-id t69:hash-table-filter!* - dict-filter-id t69:hash-table-filter* - dict-for-each-id t69:hash-table-foreach* - dict-fold-id t69:hash-table-fold* - dict->alist-id (prep-dtd-arg t69:hash-table->alist) - dict-search-id t69:hash-table-search* - dict-search!-id t69:hash-table-search!* - dict-comparator-id t69:hash-table-comparator* - dict-copy-id (prep-dtd-arg t69:hash-table-copy)))) + make-dictionary-id t69-make-hash-table* + dictionary?-id (prep-dtd-arg t69-hash-table?) + dict-ref-id t69-hash-table-ref* + dict-ref/default-id (prep-dtd-arg t69-hash-table-ref/default) + dict-set!-id t69-hash-table-set!* + dict-delete-all!-id t69-hash-table-delete-all!* + dict-contains?-id (prep-dtd-arg t69-hash-table-exists?) + dict-update/default!-id t69-hash-table-update!/default* + dict-size-id (prep-dtd-arg t69-hash-table-size) + dict-keys-id (prep-dtd-arg t69-hash-table-keys) + dict-values-id (prep-dtd-arg t69-hash-table-values) + dict-map!-id t69-hash-table-map!* + dict-filter!-id t69-hash-table-filter!* + dict-filter-id t69-hash-table-filter* + dict-for-each-id t69-hash-table-foreach* + dict-fold-id t69-hash-table-fold* + dict->alist-id (prep-dtd-arg t69-hash-table->alist) + dict-search-id t69-hash-table-search* + dict-search!-id t69-hash-table-search!* + dict-comparator-id t69-hash-table-comparator* + dict-copy-id (prep-dtd-arg t69-hash-table-copy)))) |
