Repair: it is incorrect to invoke retraction-handlers when retracting an interest

This commit is contained in:
Tony Garnock-Jones 2018-04-22 21:04:22 +01:00
parent f58c2fb8dc
commit efa7f517c4
1 changed files with 2 additions and 5 deletions

View File

@ -122,7 +122,7 @@
(set-add! (skeleton-accumulator-handlers acc) h) (set-add! (skeleton-accumulator-handlers acc) h)
(for [(vars (in-bag (skeleton-accumulator-cache acc)))] (apply-handler! h vars))) (for [(vars (in-bag (skeleton-accumulator-cache acc)))] (apply-handler! h vars)))
(define (skcont-remove! c i apply-handler!) (define (skcont-remove! c i)
(match-define (skeleton-interest _desc cs cv vs h) i) (match-define (skeleton-interest _desc cs cv vs h) i)
(define cvt (hash-ref (skeleton-continuation-table c) cs #f)) (define cvt (hash-ref (skeleton-continuation-table c) cs #f))
(when cvt (when cvt
@ -130,7 +130,6 @@
(when sc (when sc
(define acc (hash-ref (skeleton-matched-constant-table sc) vs #f)) (define acc (hash-ref (skeleton-matched-constant-table sc) vs #f))
(when acc (when acc
(for [(vars (in-bag (skeleton-accumulator-cache acc)))] (apply-handler! h vars))
(set-remove! (skeleton-accumulator-handlers acc) h) (set-remove! (skeleton-accumulator-handlers acc) h)
(when (set-empty? (skeleton-accumulator-handlers acc)) (when (set-empty? (skeleton-accumulator-handlers acc))
(hash-remove! (skeleton-matched-constant-table sc) vs))) (hash-remove! (skeleton-matched-constant-table sc) vs)))
@ -192,9 +191,7 @@
(define (remove-interest! sk i) (define (remove-interest! sk i)
(let ((sk (extend-skeleton! sk (skeleton-interest-desc i)))) (let ((sk (extend-skeleton! sk (skeleton-interest-desc i))))
(skcont-remove! (skeleton-node-continuation sk) (skcont-remove! (skeleton-node-continuation sk) i)))
i
(lambda (h vars) (apply h '- vars)))))
(define (skeleton-modify! sk term0 modify-skcont! modify-skconst! modify-skacc!) (define (skeleton-modify! sk term0 modify-skcont! modify-skconst! modify-skacc!)
(define (walk-node! sk term-stack) (define (walk-node! sk term-stack)