From 0ced7c940d57c3246c77cdbb27b9870407efb349 Mon Sep 17 00:00:00 2001 From: Tony Garnock-Jones Date: Mon, 28 Oct 2013 10:55:31 +0000 Subject: [PATCH] Ignore non-actions in enqueue-actions --- minimart/core.rkt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/minimart/core.rkt b/minimart/core.rkt index 2714577..223a8e7 100644 --- a/minimart/core.rkt +++ b/minimart/core.rkt @@ -99,10 +99,14 @@ -1 boot-actions))) +(define (event? x) (or (routing-update? x) (message? x))) +(define (action? x) (or (event? x) (process? x) (quit? x))) + (define (enqueue-actions w pid actions) (struct-copy world w [process-actions (queue-append-list (world-process-actions w) - (map (lambda (a) (cons pid a)) (flatten actions)))])) + (filter-map (lambda (a) (and (action? a) (cons pid a))) + (flatten actions)))])) (define (quiescent? w) (and (queue-empty? (world-event-queue w))