diff options
| author | 2022-08-06 11:22:05 -0400 | |
|---|---|---|
| committer | 2022-08-06 11:22:05 -0400 | |
| commit | e89c664dcabb50a28975f451252106a461be3d3f (patch) | |
| tree | 8da6ad7744c6b26cbcf3acdd7d08e83c33c5e014 /srfi/225/srfi-146-hash-impl.sld | |
| parent | Merge branch 'master' of https://github.com/johnwcowan/srfi-225 (diff) | |
| parent | return alists; refactor structure (diff) | |
Merge pull request #5 from arvyy/master
return alists; refactor structure
Diffstat (limited to '')
| -rw-r--r-- | srfi/225/srfi-146-hash-impl.sld (renamed from srfi/srfi-146-hash-impl.scm) | 73 |
1 files changed, 40 insertions, 33 deletions
diff --git a/srfi/srfi-146-hash-impl.scm b/srfi/225/srfi-146-hash-impl.sld index 609fce9..82dc769 100644 --- a/srfi/srfi-146-hash-impl.scm +++ b/srfi/225/srfi-146-hash-impl.sld @@ -1,10 +1,17 @@ -(define hash-mapping-dto - (let () +(define-library + (srfi 225 srfi-146-hash-impl) + (import (scheme base) + (srfi 146 hash) + (srfi 225 core) + (srfi 225 default-impl) + (srfi 225 indexes)) + (export hash-mapping-dto) + (begin (define (prep-dto-arg proc) (lambda (dto . args) (apply proc args))) - + (define (hashmap-map* dto proc dict) (hashmap-map (lambda (key value) (values key (proc key value))) @@ -40,33 +47,33 @@ (lambda () (call-with-values (lambda () (remove #f)) k2)))) (k result)))))) new-dict))) - - (make-dto - dictionary?-id (prep-dto-arg hashmap?) - dict-pure?-id (lambda _ #t) - dict-map-id hashmap-map* - dict-empty?-id (prep-dto-arg hashmap-empty?) - dict-contains?-id (prep-dto-arg hashmap-contains?) - dict-ref-id (prep-dto-arg hashmap-ref) - dict-ref/default-id (prep-dto-arg hashmap-ref/default) - dict-set-id (prep-dto-arg hashmap-set) - dict-adjoin-id (prep-dto-arg hashmap-adjoin) - dict-delete-id (prep-dto-arg hashmap-delete) - dict-delete-all-id (prep-dto-arg hashmap-delete-all) - dict-replace-id (prep-dto-arg hashmap-replace) - dict-intern-id (prep-dto-arg hashmap-intern) - dict-update-id (prep-dto-arg hashmap-update) - dict-update/default-id (prep-dto-arg hashmap-update/default) - dict-pop-id (prep-dto-arg hashmap-pop) - dict-filter-id (prep-dto-arg hashmap-filter) - dict-remove-id (prep-dto-arg hashmap-remove) - dict-find-update-id hashmap-find-update* - dict-size-id (prep-dto-arg hashmap-size) - dict-count-id (prep-dto-arg hashmap-count) - dict-keys-id (prep-dto-arg hashmap-keys) - dict-values-id (prep-dto-arg hashmap-values) - dict-entries-id (prep-dto-arg hashmap-entries) - dict-fold-id (prep-dto-arg hashmap-fold) - dict-map->list-id (prep-dto-arg hashmap-map->list) - dict->alist-id (prep-dto-arg hashmap->alist) - dict-comparator-id (prep-dto-arg hashmap-key-comparator)))) + (define hash-mapping-dto + (make-dto + dictionary?-id (prep-dto-arg hashmap?) + dict-pure?-id (lambda _ #t) + dict-map-id hashmap-map* + dict-empty?-id (prep-dto-arg hashmap-empty?) + dict-contains?-id (prep-dto-arg hashmap-contains?) + dict-ref-id (prep-dto-arg hashmap-ref) + dict-ref/default-id (prep-dto-arg hashmap-ref/default) + dict-set-id (prep-dto-arg hashmap-set) + dict-adjoin-id (prep-dto-arg hashmap-adjoin) + dict-delete-id (prep-dto-arg hashmap-delete) + dict-delete-all-id (prep-dto-arg hashmap-delete-all) + dict-replace-id (prep-dto-arg hashmap-replace) + dict-intern-id (prep-dto-arg hashmap-intern) + dict-update-id (prep-dto-arg hashmap-update) + dict-update/default-id (prep-dto-arg hashmap-update/default) + dict-pop-id (prep-dto-arg hashmap-pop) + dict-filter-id (prep-dto-arg hashmap-filter) + dict-remove-id (prep-dto-arg hashmap-remove) + dict-find-update-id hashmap-find-update* + dict-size-id (prep-dto-arg hashmap-size) + dict-count-id (prep-dto-arg hashmap-count) + dict-keys-id (prep-dto-arg hashmap-keys) + dict-values-id (prep-dto-arg hashmap-values) + dict-entries-id (prep-dto-arg hashmap-entries) + dict-fold-id (prep-dto-arg hashmap-fold) + dict-map->list-id (prep-dto-arg hashmap-map->list) + dict->alist-id (prep-dto-arg hashmap->alist) + dict-comparator-id (prep-dto-arg hashmap-key-comparator))))) |
