diff options
| author | 2021-08-19 01:22:35 +0300 | |
|---|---|---|
| committer | 2021-08-19 01:22:35 +0300 | |
| commit | 4c0820fa1b45ef4ea6976e950003fc48a70f4075 (patch) | |
| tree | bb744fd21eb5e7c135f1305075c1724ef82e9d38 /srfi/alist-impl.scm | |
| parent | mapping implementation (diff) | |
update spec; fix default copy
Diffstat (limited to 'srfi/alist-impl.scm')
| -rw-r--r-- | srfi/alist-impl.scm | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/srfi/alist-impl.scm b/srfi/alist-impl.scm index 4463d1c..e64dc97 100644 --- a/srfi/alist-impl.scm +++ b/srfi/alist-impl.scm @@ -96,8 +96,14 @@ (proc (car e) (cdr e))) (for-each proc* alist)) + (define (alist-copy dtd alist) + (map + (lambda (e) + (cons (car e) (cdr e))) + alist)) + (define (alist->alist dtd alist) - alist) + (alist-copy dtd alist)) (define (alist-comparator dtd dictionary) (make-comparator (lambda args #t) @@ -117,7 +123,8 @@ dict-size-index alist-size dict-for-each-index alist-foreach dict->alist-index alist->alist - dict-comparator-index alist-comparator)) + dict-comparator-index alist-comparator + dict-copy-index alist-copy)) (define alist-eqv-dtd (make-alist-dtd eqv?)) (define alist-equal-dtd (make-alist-dtd equal?)) |
