From b5c57381fafd70af2df629131d4b8e64197306b0 Mon Sep 17 00:00:00 2001 From: Tony Garnock-Jones Date: Thu, 10 Jun 2021 14:41:57 +0200 Subject: [PATCH] Simplify during* --- syndicate/syntax.rkt | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/syndicate/syntax.rkt b/syndicate/syntax.rkt index 8491a40..e45890e 100644 --- a/syndicate/syntax.rkt +++ b/syndicate/syntax.rkt @@ -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)]))))