From c8cc8051a173be5250cf1bf69b2e6cfaf6a039a8 Mon Sep 17 00:00:00 2001 From: Sam Caldwell Date: Fri, 10 Mar 2017 13:39:50 -0500 Subject: [PATCH] don't run new facets asap --- racket/syndicate/little-actors/core.rkt | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/racket/syndicate/little-actors/core.rkt b/racket/syndicate/little-actors/core.rkt index 8fbcb1d..9fabfba 100644 --- a/racket/syndicate/little-actors/core.rkt +++ b/racket/syndicate/little-actors/core.rkt @@ -631,8 +631,8 @@ (define-values (final-sto final-as new-children) (for/fold ([sto new-sto] [as as] - [new-children (list)]) - ([ft (in-list (append children new-facets))]) + [new-children new-facets]) + ([ft (in-list children)]) (match (run-facets ft π sto e) [(ok new-sto new-ft more-as) (values new-sto @@ -892,4 +892,14 @@ (on (asserted (observe "poodle")) (send! "poodle")))))) (test-trace (trace (message "success")) - stop-when-react)) \ No newline at end of file + stop-when-react)) + +(module+ test + (define do-new-facets-run-immediately + '( + (actor (react (on (message "hello") + (react (on (message "hello") + (send! "I am here")))))) + (actor (react (on-start (send! "hello")))))) + (check-false (run-with-trace (trace (message "I am here")) + do-new-facets-run-immediately))) \ No newline at end of file