X-Git-Url: https://jxself.org/git/?a=blobdiff_plain;f=8sync%2Fsystems%2Factors.scm;h=f9b9047ac4a83fc1d06e82bb798422c0f7750dae;hb=148aae4afbbbfa1a0845746294acb1385deda9b6;hp=87d29ec1b036b4fabae320b840a9866e86e5010d;hpb=b3a4b6bec6422ef66724fda5bf57f4e2552fe4fc;p=8sync.git diff --git a/8sync/systems/actors.scm b/8sync/systems/actors.scm index 87d29ec..f9b9047 100644 --- a/8sync/systems/actors.scm +++ b/8sync/systems/actors.scm @@ -349,7 +349,7 @@ more compact following syntax: (simple-dispatcher (list (%expand-action-item action-item) ...))))) -(define-syntax-rule (define-simple-actor class (actions ...)) +(define-syntax-rule (define-simple-actor class actions ...) (define-class class () (message-handler #:init-value (make-action-dispatch actions ...) @@ -464,7 +464,14 @@ more compact following syntax: (define (resume-waiting-coroutine) (match (hash-remove! (hive-waiting-coroutines hive) (message-in-reply-to message)) - ((_ . kont) + ((_ . (resume-actor-id . kont)) + (if (not (equal? (message-to message) + resume-actor-id)) + (throw 'resuming-to-wrong-actor + "Attempted to resume a coroutine to the wrong actor!" + #:expected-actor-id (message-to message) + #:got-actor-id resume-actor-id + #:message message)) (kont message)) (#f (throw 'no-waiting-coroutine "message in-reply-to tries to resume nonexistent coroutine"