diff options
| author | 2022-09-21 16:13:05 -0400 | |
|---|---|---|
| committer | 2022-09-21 16:13:05 -0400 | |
| commit | 4653e001940b9720d3f9b10ce8f1362a177c33d2 (patch) | |
| tree | dfd55a47b54f85c984cae6b7b7aa9718af79c0d1 /srfi | |
| parent | editorial (diff) | |
Added ! to all updaters
Diffstat (limited to 'srfi')
| -rw-r--r-- | srfi/225/alist-impl.sld | 2 | ||||
| -rw-r--r-- | srfi/225/core-exports.scm | 24 | ||||
| -rw-r--r-- | srfi/225/core-impl.scm | 32 | ||||
| -rw-r--r-- | srfi/225/default-impl.sld | 78 | ||||
| -rw-r--r-- | srfi/225/indexes-exports.scm | 24 | ||||
| -rw-r--r-- | srfi/225/indexes.sld | 24 | ||||
| -rw-r--r-- | srfi/225/srfi-125-impl.sld | 14 | ||||
| -rw-r--r-- | srfi/225/srfi-126-impl.sld | 12 | ||||
| -rw-r--r-- | srfi/225/srfi-146-hash-impl.sld | 20 | ||||
| -rw-r--r-- | srfi/225/srfi-146-impl.sld | 20 | ||||
| -rw-r--r-- | srfi/225/srfi-69-impl.sld | 8 |
11 files changed, 129 insertions, 129 deletions
diff --git a/srfi/225/alist-impl.sld b/srfi/225/alist-impl.sld index 01df92a..bbb0f45 100644 --- a/srfi/225/alist-impl.sld +++ b/srfi/225/alist-impl.sld @@ -91,7 +91,7 @@ dict-pure?-id alist-pure? dict-map-id alist-map dict-filter-id alist-filter - dict-find-update-id (make-alist-find-update key=) + dict-find-update!-id (make-alist-find-update key=) dict-size-id alist-size dict->alist-id alist->alist dict-comparator-id alist-comparator)) diff --git a/srfi/225/core-exports.scm b/srfi/225/core-exports.scm index 90e2992..a3dab1d 100644 --- a/srfi/225/core-exports.scm +++ b/srfi/225/core-exports.scm @@ -12,19 +12,19 @@ dict-comparator ;; mutation - dict-set - dict-adjoin - dict-delete - dict-delete-all - dict-replace - dict-intern - dict-update - dict-update/default - dict-pop + dict-set! + dict-adjoin! + dict-delete! + dict-delete!-all! + dict-replace! + dict-intern! + dict-update! + dict-update!/default! + dict-pop! dict-map dict-filter dict-remove - dict-find-update + dict-find-update! ;; whole dictionary dict-size @@ -41,8 +41,8 @@ ;; iteration dict-for-each dict->generator - dict-set-accumulator - dict-adjoin-accumulator + dict-set!-accumulator + dict-adjoin!-accumulator ;; dictionary type descriptors dto? diff --git a/srfi/225/core-impl.scm b/srfi/225/core-impl.scm index 2e38432..f65cd9e 100644 --- a/srfi/225/core-impl.scm +++ b/srfi/225/core-impl.scm @@ -47,33 +47,33 @@ ((dto-ref-stx dto dict-ref-id) dto dict key failure success)))) (define/dict-proc dict-ref/default dict-ref/default-id) -(define/dict-proc dict-set dict-set-id) -(define/dict-proc dict-adjoin dict-adjoin-id) -(define/dict-proc dict-delete dict-delete-id) -(define/dict-proc dict-delete-all dict-delete-all-id) -(define/dict-proc dict-replace dict-replace-id) -(define/dict-proc dict-intern dict-intern-id) - -(define dict-update +(define/dict-proc dict-set! dict-set!-id) +(define/dict-proc dict-adjoin! dict-adjoin!-id) +(define/dict-proc dict-delete! dict-delete!-id) +(define/dict-proc dict-delete!-all! dict-delete!-all!-id) +(define/dict-proc dict-replace! dict-replace!-id) +(define/dict-proc dict-intern! dict-intern!-id) + +(define dict-update! (case-lambda ((dto dict key updater) - (dict-update dto dict key updater + (dict-update! dto dict key updater (lambda () (error "Key not found in dictionary" dict key)) values)) ((dto dict key updater failure) - (dict-update dto dict key updater failure values)) + (dict-update! dto dict key updater failure values)) ((dto dict key updater failure success) (assume (dto? dto)) - ((dto-ref-stx dto dict-update-id) dto dict key updater failure success)))) + ((dto-ref-stx dto dict-update!-id) dto dict key updater failure success)))) -(define/dict-proc dict-update/default dict-update/default-id) -(define/dict-proc dict-pop dict-pop-id) +(define/dict-proc dict-update!/default! dict-update!/default!-id) +(define/dict-proc dict-pop! dict-pop!-id) (define/dict-proc dict-map dict-map-id) (define/dict-proc dict-filter dict-filter-id) (define/dict-proc dict-remove dict-remove-id) -(define/dict-proc dict-find-update dict-find-update-id) +(define/dict-proc dict-find-update! dict-find-update!-id) (define/dict-proc dict-size dict-size-id) (define/dict-proc dict-count dict-count-id) (define/dict-proc dict-any dict-any-id) @@ -98,8 +98,8 @@ ((dto dict start) (dict->generator dto dict start #f)) ((dto dict start end) ((dto-ref-stx dto dict->generator-id) dto dict start end)))) -(define/dict-proc dict-set-accumulator dict-set-accumulator-id) -(define/dict-proc dict-adjoin-accumulator dict-adjoin-accumulator-id) +(define/dict-proc dict-set!-accumulator dict-set!-accumulator-id) +(define/dict-proc dict-adjoin!-accumulator dict-adjoin!-accumulator-id) (define (dto-ref dto procindex) (dto-ref-stx dto procindex)) diff --git a/srfi/225/default-impl.sld b/srfi/225/default-impl.sld index 0c7d75c..4d815f9 100644 --- a/srfi/225/default-impl.sld +++ b/srfi/225/default-impl.sld @@ -18,7 +18,7 @@ (define default-dictionary? (not-implemented "dictionary?")) (define default-dict-pure? (not-implemented "dict-pure?")) (define default-dict-size (not-implemented "dict-size")) - (define default-dict-find-update (not-implemented "dict-find-update")) + (define default-dict-find-update! (not-implemented "dict-find-update!")) (define (default-dict-empty? dto dictionary) (= 0 (dict-size dto dictionary))) @@ -45,7 +45,7 @@ (lambda (x) #t))) (define (default-dict-ref dto dictionary key failure success) - (dict-find-update dto dictionary key + (dict-find-update! dto dictionary key (lambda (insert ignore) (failure)) (lambda (key value update remove) @@ -57,7 +57,7 @@ (lambda (x) x))) ;; private - (define (default-dict-set* dto dictionary use-old? objs) + (define (default-dict-set!* dto dictionary use-old? objs) (let loop ((objs objs) (dictionary dictionary)) (cond @@ -67,7 +67,7 @@ (error "mismatch of key / values argument list" objs)) (else (let* ((key (car objs)) (value (cadr objs)) - (new-d (dict-find-update dto dictionary key + (new-d (dict-find-update! dto dictionary key (lambda (insert ignore) (insert value)) (lambda (key old-value update delete) @@ -75,22 +75,22 @@ (loop (cddr objs) new-d)))))) - (define (default-dict-set dto dictionary . objs) - (default-dict-set* dto dictionary #f objs)) + (define (default-dict-set! dto dictionary . objs) + (default-dict-set!* dto dictionary #f objs)) - (define (default-dict-adjoin dto dictionary . objs) - (default-dict-set* dto dictionary #t objs)) + (define (default-dict-adjoin! dto dictionary . objs) + (default-dict-set!* dto dictionary #t objs)) - (define (default-dict-delete dto dictionary . keys) - (dict-delete-all dto dictionary keys)) + (define (default-dict-delete! dto dictionary . keys) + (dict-delete!-all! dto dictionary keys)) - (define (default-dict-delete-all dto dictionary keylist) + (define (default-dict-delete!-all! dto dictionary keylist) (let loop ((keylist keylist) (d dictionary)) (cond ((null? keylist) d) (else (let* ((key (car keylist)) - (new-d (dict-find-update dto d key + (new-d (dict-find-update! dto d key (lambda (_ ignore) (ignore)) (lambda (key old-value _ delete) @@ -98,41 +98,41 @@ (loop (cdr keylist) new-d)))))) - (define (default-dict-replace dto dictionary key value) - (dict-find-update dto dictionary key + (define (default-dict-replace! dto dictionary key value) + (dict-find-update! dto dictionary key (lambda (_ ignore) (ignore)) (lambda (key old-value update _) (update key value)))) - (define (default-dict-intern dto dictionary key failure) - (dict-find-update dto dictionary key + (define (default-dict-intern! dto dictionary key failure) + (dict-find-update! dto dictionary key (lambda (insert _) (let ((value (failure))) (values (insert value) value))) (lambda (key value update _) (values dictionary value)))) - (define (default-dict-update dto dictionary key updater failure success) - (dict-find-update dto dictionary key + (define (default-dict-update! dto dictionary key updater failure success) + (dict-find-update! dto dictionary key (lambda (insert ignore) (insert (updater (failure)))) (lambda (key value update _) (update key (updater (success value)))))) - (define (default-dict-update/default dto dictionary key updater default) - (dict-update dto dictionary key updater + (define (default-dict-update!/default! dto dictionary key updater default) + (dict-update! dto dictionary key updater (lambda () default) (lambda (x) x))) - (define (default-dict-pop dto dictionary) + (define (default-dict-pop! dto dictionary) (define (do-pop) (call/cc (lambda (cont) (dict-for-each dto (lambda (key value) (define new-dict - (dict-delete-all dto dictionary (list key))) + (dict-delete!-all! dto dictionary (list key))) (cont new-dict key value)) dictionary)))) (define empty? (dict-empty? dto dictionary)) @@ -149,7 +149,7 @@ (lambda (key) (not (pred key (dict-ref dto dictionary key)))) keys)) - (dict-delete-all dto dictionary keys-to-delete)) + (dict-delete!-all! dto dictionary keys-to-delete)) (define (default-dict-remove dto pred dictionary) (dict-filter dto (lambda (key value) @@ -329,11 +329,11 @@ dict (set! dict (acc-proc dto dict (car arg) (cdr arg)))))) - (define (default-dict-set-accumulator dto dict) - (default-dict-accumulator dto dict dict-set)) + (define (default-dict-set!-accumulator dto dict) + (default-dict-accumulator dto dict dict-set!)) - (define (default-dict-adjoin-accumulator dto dict) - (default-dict-accumulator dto dict dict-adjoin)) + (define (default-dict-adjoin!-accumulator dto dict) + (default-dict-accumulator dto dict dict-adjoin!)) (define null-dto (make-dto-private (make-vector dict-procedures-count #f))) @@ -348,19 +348,19 @@ dict-pure?-id default-dict-pure? dict-ref-id default-dict-ref dict-ref/default-id default-dict-ref/default - dict-set-id default-dict-set - dict-adjoin-id default-dict-adjoin - dict-delete-id default-dict-delete - dict-delete-all-id default-dict-delete-all - dict-replace-id default-dict-replace - dict-intern-id default-dict-intern - dict-update-id default-dict-update - dict-update/default-id default-dict-update/default - dict-pop-id default-dict-pop + dict-set!-id default-dict-set! + dict-adjoin!-id default-dict-adjoin! + dict-delete!-id default-dict-delete! + dict-delete!-all!-id default-dict-delete!-all! + dict-replace!-id default-dict-replace! + dict-intern!-id default-dict-intern! + dict-update!-id default-dict-update! + dict-update!/default!-id default-dict-update!/default! + dict-pop!-id default-dict-pop! dict-map-id default-dict-map dict-filter-id default-dict-filter dict-remove-id default-dict-remove - dict-find-update-id default-dict-find-update + dict-find-update!-id default-dict-find-update! dict-size-id default-dict-size dict-count-id default-dict-count dict-any-id default-dict-any @@ -377,8 +377,8 @@ ;; generator procedures dict->generator-id default-dict->generator - dict-set-accumulator-id default-dict-set-accumulator - dict-adjoin-accumulator-id default-dict-adjoin-accumulator))) + dict-set!-accumulator-id default-dict-set!-accumulator + dict-adjoin!-accumulator-id default-dict-adjoin!-accumulator))) (define (make-dto . lst) (make-modified-dto default-dto lst)) diff --git a/srfi/225/indexes-exports.scm b/srfi/225/indexes-exports.scm index fcb49ae..ff81ff3 100644 --- a/srfi/225/indexes-exports.scm +++ b/srfi/225/indexes-exports.scm @@ -1,7 +1,7 @@ (export ;; required dictionary?-id - dict-find-update-id + dict-find-update!-id dict-comparator-id dict-map-id dict-pure?-id @@ -10,32 +10,32 @@ ;; extra dict->alist-id - dict-adjoin-accumulator-id - dict-adjoin-id + dict-adjoin!-accumulator-id + dict-adjoin!-id dict-any-id dict-contains?-id dict-count-id - dict-delete-all-id - dict-delete-id + dict-delete!-all!-id + dict-delete!-id dict-empty?-id dict-entries-id dict-every-id dict-filter-id dict-fold-id dict-for-each-id - dict-intern-id + dict-intern!-id dict-keys-id dict-map->list-id dict-map-id - dict-pop-id + dict-pop!-id dict-ref-id dict-ref/default-id dict-remove-id - dict-replace-id - dict-set-accumulator-id - dict-set-id - dict-update-id - dict-update/default-id + dict-replace!-id + dict-set!-accumulator-id + dict-set!-id + dict-update!-id + dict-update!/default!-id dict-values-id dict=?-id dict->generator-id) diff --git a/srfi/225/indexes.sld b/srfi/225/indexes.sld index b746c39..c1e1763 100644 --- a/srfi/225/indexes.sld +++ b/srfi/225/indexes.sld @@ -16,19 +16,19 @@ (define dict-pure?-id (proc-id-inc)) (define dict-ref-id (proc-id-inc)) (define dict-ref/default-id (proc-id-inc)) - (define dict-set-id (proc-id-inc)) - (define dict-adjoin-id (proc-id-inc)) - (define dict-delete-id (proc-id-inc)) - (define dict-delete-all-id (proc-id-inc)) - (define dict-replace-id (proc-id-inc)) - (define dict-intern-id (proc-id-inc)) - (define dict-update-id (proc-id-inc)) - (define dict-update/default-id (proc-id-inc)) - (define dict-pop-id (proc-id-inc)) + (define dict-set!-id (proc-id-inc)) + (define dict-adjoin!-id (proc-id-inc)) + (define dict-delete!-id (proc-id-inc)) + (define dict-delete!-all!-id (proc-id-inc)) + (define dict-replace!-id (proc-id-inc)) + (define dict-intern!-id (proc-id-inc)) + (define dict-update!-id (proc-id-inc)) + (define dict-update!/default!-id (proc-id-inc)) + (define dict-pop!-id (proc-id-inc)) (define dict-map-id (proc-id-inc)) (define dict-filter-id (proc-id-inc)) (define dict-remove-id (proc-id-inc)) - (define dict-find-update-id (proc-id-inc)) + (define dict-find-update!-id (proc-id-inc)) (define dict-size-id (proc-id-inc)) (define dict-count-id (proc-id-inc)) (define dict-any-id (proc-id-inc)) @@ -42,7 +42,7 @@ (define dict-comparator-id (proc-id-inc)) (define dict-for-each-id (proc-id-inc)) (define dict->generator-id (proc-id-inc)) - (define dict-set-accumulator-id (proc-id-inc)) - (define dict-adjoin-accumulator-id (proc-id-inc)) + (define dict-set!-accumulator-id (proc-id-inc)) + (define dict-adjoin!-accumulator-id (proc-id-inc)) (define dict-procedures-count (proc-id-inc)) ;; only used for tracking backing vector size )) diff --git a/srfi/225/srfi-125-impl.sld b/srfi/225/srfi-125-impl.sld index a987787..a406fe0 100644 --- a/srfi/225/srfi-125-impl.sld +++ b/srfi/225/srfi-125-impl.sld @@ -129,16 +129,16 @@ 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-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-remove-id t125-hash-table-remove* - dict-find-update-id t125-hash-table-find-update* + dict-find-update!-id t125-hash-table-find-update* dict-size-id t125-hash-table-size* dict-keys-id t125-hash-table-keys* dict-values-id t125-hash-table-values* diff --git a/srfi/225/srfi-126-impl.sld b/srfi/225/srfi-126-impl.sld index 5acc2cc..9b9fd74 100644 --- a/srfi/225/srfi-126-impl.sld +++ b/srfi/225/srfi-126-impl.sld @@ -118,15 +118,15 @@ dict-contains?-id (prep-dto-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-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-remove-id t126-hashtable-remove* - dict-find-update-id t126-hashtable-find-update* + dict-find-update!-id t126-hashtable-find-update* dict-size-id (prep-dto-arg t126-hashtable-size) dict-keys-id t126-hashtable-keys* dict-values-id t126-hashtable-values* diff --git a/srfi/225/srfi-146-hash-impl.sld b/srfi/225/srfi-146-hash-impl.sld index 82dc769..d29bffc 100644 --- a/srfi/225/srfi-146-hash-impl.sld +++ b/srfi/225/srfi-146-hash-impl.sld @@ -56,18 +56,18 @@ 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-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-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) diff --git a/srfi/225/srfi-146-impl.sld b/srfi/225/srfi-146-impl.sld index d9577b4..3acb4b9 100644 --- a/srfi/225/srfi-146-impl.sld +++ b/srfi/225/srfi-146-impl.sld @@ -57,18 +57,18 @@ dict-contains?-id (prep-dto-arg mapping-contains?) dict-ref-id (prep-dto-arg mapping-ref) dict-ref/default-id (prep-dto-arg mapping-ref/default) - dict-set-id (prep-dto-arg mapping-set) - dict-adjoin-id (prep-dto-arg mapping-adjoin) - dict-delete-id (prep-dto-arg mapping-delete) - dict-delete-all-id (prep-dto-arg mapping-delete-all) - dict-replace-id (prep-dto-arg mapping-replace) - dict-intern-id (prep-dto-arg mapping-intern) - dict-update-id (prep-dto-arg mapping-update) - dict-update/default-id (prep-dto-arg mapping-update/default) - dict-pop-id (prep-dto-arg mapping-pop) + dict-set!-id (prep-dto-arg mapping-set) + dict-adjoin!-id (prep-dto-arg mapping-adjoin) + dict-delete!-id (prep-dto-arg mapping-delete) + dict-delete!-all!-id (prep-dto-arg mapping-delete-all) + dict-replace!-id (prep-dto-arg mapping-replace) + dict-intern!-id (prep-dto-arg mapping-intern) + dict-update!-id (prep-dto-arg mapping-update) + dict-update!/default!-id (prep-dto-arg mapping-update/default) + dict-pop!-id (prep-dto-arg mapping-pop) dict-filter-id (prep-dto-arg mapping-filter) dict-remove-id (prep-dto-arg mapping-remove) - dict-find-update-id mapping-find-update* + dict-find-update!-id mapping-find-update* dict-size-id (prep-dto-arg mapping-size) dict-count-id (prep-dto-arg mapping-count) dict-keys-id (prep-dto-arg mapping-keys) diff --git a/srfi/225/srfi-69-impl.sld b/srfi/225/srfi-69-impl.sld index 6d04e4e..be4c6db 100644 --- a/srfi/225/srfi-69-impl.sld +++ b/srfi/225/srfi-69-impl.sld @@ -94,10 +94,10 @@ dict-pure?-id t69-hash-table-pure?* dict-ref-id t69-hash-table-ref* dict-ref/default-id (prep-dto-arg t69-hash-table-ref/default) - dict-set-id t69-hash-table-set!* - dict-delete-all-id t69-hash-table-delete-all!* + dict-set!-id t69-hash-table-set!* + dict-delete!-all!-id t69-hash-table-delete-all!* dict-contains?-id (prep-dto-arg t69-hash-table-exists?) - dict-update/default-id t69-hash-table-update!/default* + dict-update!/default!-id t69-hash-table-update!/default* dict-size-id (prep-dto-arg t69-hash-table-size) dict-keys-id (prep-dto-arg t69-hash-table-keys) dict-values-id (prep-dto-arg t69-hash-table-values) @@ -105,5 +105,5 @@ dict-filter-id t69-hash-table-filter!* dict-fold-id t69-hash-table-fold* dict->alist-id (prep-dto-arg t69-hash-table->alist) - dict-find-update-id t69-hash-table-find-update!* + dict-find-update!-id t69-hash-table-find-update!* dict-comparator-id t69-hash-table-comparator*)))) |
