summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Peter McGoron 2025-07-17 20:11:52 -0400
committerGravatar Peter McGoron 2025-07-17 20:11:52 -0400
commit7008650fc8eb29e10d8f682035a87b953c4ca629 (patch)
treee1ea0a4c395af76be937383ae9685a33191f8f62
parentGenerate. (diff)
package for chicken1.0.0
-rw-r--r--.gitignore9
-rw-r--r--srfi/225.sld67
-rw-r--r--srfi/225/core.sld16
-rw-r--r--tests/run.scm (renamed from srfi-225-test.scm)122
4 files changed, 50 insertions, 164 deletions
diff --git a/.gitignore b/.gitignore
index 2d6e882..0be405a 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,2 +1,9 @@
*~
-Dictionaries.log \ No newline at end of file
+Dictionaries.log
+*.o
+*.so
+*.import.scm
+*.link
+*.install.sh
+*.build.sh
+*.tar.gz
diff --git a/srfi/225.sld b/srfi/225.sld
index 4b6f021..0c36a33 100644
--- a/srfi/225.sld
+++ b/srfi/225.sld
@@ -1,57 +1,18 @@
(define-library
- (srfi 225)
-
+ (srfi 225)
(import
- (scheme base)
- (srfi 1)
- (srfi 128)
- (srfi 225 core)
- (srfi 225 default-impl)
- (srfi 225 indexes))
-
+ (scheme base)
+ (srfi 1)
+ (srfi 128)
+ (srfi 225 core)
+ (srfi 225 default-impl)
+ (srfi 225 indexes)
+ (srfi 225 alist-impl)
+ (srfi 225 srfi-69-impl)
+ (srfi 225 srfi-146-impl)
+ (srfi 225 srfi-146-hash-impl))
(include-library-declarations "225/core-exports.scm")
(include-library-declarations "225/indexes-exports.scm")
- (export make-dto)
-
- ;; common implementations
- (import (srfi 225 alist-impl))
- (export
- make-alist-dto
- eqv-alist-dto
- equal-alist-dto)
-
- ;; library-dependent DTO exports
- ;; and implementations
- ;;
- ;;srfi-69-dto
- ;;hash-table-dto
- ;;srfi-126-dto
- ;;mapping-dto
- ;;hash-mapping-dto
-
- (cond-expand
- ((library (srfi 69))
- (import (srfi 225 srfi-69-impl))
- (export srfi-69-dto))
- (else))
-
- (cond-expand
- ((library (srfi 125))
- (import (srfi 225 srfi-125-impl))
- (export hash-table-dto))
- (else))
-
- (cond-expand
- ((library (srfi 126))
- (import (srfi 225 srfi-126-impl))
- (export srfi-126-dto))
- (else))
-
- (cond-expand
- ((and (library (srfi 146))
- (library (srfi 146 hash)))
- (import (srfi 225 srfi-146-impl)
- (srfi 225 srfi-146-hash-impl))
- (export mapping-dto
- hash-mapping-dto))
- (else)))
+ (export make-dto srfi-69-dto
+ make-alist-dto eqv-alist-dto equal-alist-dto
+ mapping-dto hash-mapping-dto))
diff --git a/srfi/225/core.sld b/srfi/225/core.sld
index 573464d..b594eb6 100644
--- a/srfi/225/core.sld
+++ b/srfi/225/core.sld
@@ -1,18 +1,14 @@
(define-library
- (srfi 225 core)
-
+ (srfi 225 core)
(import (scheme base)
(scheme case-lambda)
(srfi 1)
(srfi 128)
- (srfi 225 indexes))
- (cond-expand
- ((library (srfi 145)) (import (srfi 145)))
- (else (include "assumptions.scm")))
-
- (include "core-impl.scm")
- (include-library-declarations "core-exports.scm")
+ (srfi 225 indexes)
+ (srfi 145))
(export make-dto-private
make-modified-dto
procvec
- dict-procedures-count))
+ dict-procedures-count)
+ (include-library-declarations "core-exports.scm")
+ (include "core-impl.scm"))
diff --git a/srfi-225-test.scm b/tests/run.scm
index 478b431..027e1ad 100644
--- a/srfi-225-test.scm
+++ b/tests/run.scm
@@ -4,49 +4,11 @@
(srfi 1)
(srfi 128)
(srfi 158)
- (srfi 225))
-
-(cond-expand
- ((library (srfi 69))
- (import (prefix (srfi 69) t69-)))
- (else))
-
-(cond-expand
- ((library (srfi 125))
- (import (prefix (srfi 125) t125-)))
- (else))
-
-(cond-expand
- ((library (srfi 126))
- (import (prefix (srfi 126) t126-)))
- (else))
-
-(cond-expand
- ((and (library (srfi 146))
- (library (srfi 146 hash)))
- (import (srfi 146)
- (srfi 146 hash)))
- (else))
-
-(cond-expand
- (chibi
- (import (rename (except (chibi test) test-equal)
- (test test-equal)
- (test-group test-group*)))
- (define test-skip-count 0)
- (define (test-skip n)
- (set! test-skip-count n))
- (define-syntax test-group
- (syntax-rules ()
- ((_ name body ...)
- (test-group*
- name
- (if (> test-skip-count 0)
- (set! test-skip-count (- test-skip-count 1))
- (let ()
- body ...)))))))
- (else
- (import (srfi 64))))
+ (srfi 225)
+ (prefix (srfi 69) t69-)
+ (srfi 146)
+ (srfi 146 hash)
+ (srfi 64))
;; returns new wrapper dto
;; which counts how often each dto's method was called
@@ -881,11 +843,7 @@
#f
#f))
-(cond-expand
- ((and (library (srfi 69))
- (not gauche) ;; gauche has bug with comparator retrieval from srfi 69 table
- )
- (test-group
+(test-group
"srfi-69"
(do-test
srfi-69-dto
@@ -897,47 +855,12 @@
alist)
table)
(make-default-comparator)
- #t)))
- (else))
+ #t))
-(cond-expand
- ((library (srfi 125))
- (test-group
- "srfi-125"
- (do-test
- hash-table-dto
- (lambda (alist)
- (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)))
- alist)
- table)
- (make-default-comparator)
- #t)))
- (else))
-(cond-expand
- ((library (srfi 126))
- (test-group
- "srfi-126 (r6rs)"
- (do-test
- srfi-126-dto
- (lambda (alist)
- (define table (t126-make-eqv-hashtable))
- (for-each
- (lambda (pair)
- (t126-hashtable-set! table (car pair) (cdr pair)))
- alist)
- table)
- (make-default-comparator)
- #t)))
- (else))
-(cond-expand
- ((and (library (srfi 146))
- (library (srfi 146 hash)))
- (test-group
+
+(test-group
"srfi-146"
(define cmp (make-default-comparator))
(do-test
@@ -955,23 +878,22 @@
"srfi-146 dict-comparator"
(test-equal cmp (dict-comparator mapping-dto (mapping cmp)))))
- (test-group
- "srfi-146 hash"
+(test-group
+ "srfi-146 hash"
(define cmp (make-default-comparator))
(do-test
- hash-mapping-dto
- (lambda (alist)
- (let loop ((table (hashmap cmp))
+ hash-mapping-dto
+ (lambda (alist)
+ (let loop ((table (hashmap cmp))
(entries alist))
- (if (null? entries)
- table
- (loop (hashmap-set! table (caar entries) (cdar entries))
- (cdr entries)))))
- cmp
- #f)
+ (if (null? entries)
+ table
+ (loop (hashmap-set! table (caar entries) (cdar entries))
+ (cdr entries)))))
+ cmp
+ #f)
(test-group
- "srfi-146 hash dict-comparator"
- (test-equal cmp (dict-comparator hash-mapping-dto (hashmap cmp))))))
- (else))
+ "srfi-146 hash dict-comparator"
+ (test-equal cmp (dict-comparator hash-mapping-dto (hashmap cmp)))))
(test-end)