Simplify during*

This commit is contained in:
Tony Garnock-Jones 2021-06-10 14:41:57 +02:00
parent 2f4525b031
commit b5c57381fa
1 changed files with 5 additions and 14 deletions

View File

@ -239,23 +239,14 @@
(entity #:name name
#:assert
(lambda (value handle)
(let ((facet (react (facet-prevent-inert-check! this-facet)
(f value))))
(match (hash-ref assertion-map handle #f)
[#f
(hash-set! assertion-map handle facet)]
['dead
(hash-remove! assertion-map handle)
(stop-facet facet)]
[_
(error 'during "Duplicate assertion handle ~a" handle)])))
(hash-set! assertion-map
handle
(react (facet-prevent-inert-check! this-facet)
(f value))))
#:retract
(lambda (handle)
(match (hash-ref assertion-map handle #f)
[#f
(hash-set! assertion-map handle 'dead)]
['dead
(error 'during "Duplicate retraction handle ~a" handle)]
[#f (void)]
[facet
(hash-remove! assertion-map handle)
(stop-facet facet)]))))