From b96114f774f2a804741e1f2f1f6edd71646483b9 Mon Sep 17 00:00:00 2001 From: Tony Garnock-Jones Date: Fri, 13 Jan 2012 17:05:01 -0500 Subject: [PATCH] Make raw spawning the default. --- os-big-bang.rkt | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/os-big-bang.rkt b/os-big-bang.rkt index 7806649..b705388 100644 --- a/os-big-bang.rkt +++ b/os-big-bang.rkt @@ -11,7 +11,6 @@ (struct-out send-message) (struct-out send-meta-message) (struct-out spawn) - (struct-out spawn-raw) (struct-out on-message) (struct-out on-meta-message) @@ -31,14 +30,12 @@ ;; -- (unsubscribe SID), to remove ALL previously-added subscriptions with this SID ;; -- (send-message Message), to emit a message into the local medium ;; -- (send-meta-message MetaMessage), to emit a message into the containing medium -;; -- (spawn OtherWorldState ListOf), to start a new independent sibling in the local medium -;; -- (spawn-raw BootK), to start a new sibling in the raw os.rkt eventing model +;; -- (spawn BootK), to start a new sibling in the raw os.rkt eventing model (struct subscribe (sid event-description) #:transparent) (struct unsubscribe (sid) #:transparent) (struct send-message (body) #:transparent) (struct send-meta-message (body) #:transparent) -(struct spawn (initial-state initial-actions) #:transparent) -(struct spawn-raw (thunk) #:transparent) +(struct spawn (thunk) #:transparent) ;; An EventDescription is one of ;; -- (on-message MessagePattern (Message WorldState -> Transition)), conditionally @@ -105,8 +102,8 @@ (send-message-body a)) (for/list [(a actions) #:when (send-meta-message? a)] (send-meta-message-body a)) - (for/list [(a actions) #:when (or (spawn? a) (spawn-raw? a))] - (spawn->runnable a)))) + (for/list [(a actions) #:when (spawn? a)] + (spawn-thunk a)))) (define (update-world w new-state actions) (world new-state @@ -122,13 +119,6 @@ (world-subscriptions w) actions))) -(define (spawn->runnable s) - (match s - [(spawn initial-state initial-actions) - (apply os-big-bang initial-state initial-actions)] - [(spawn-raw thunk) - thunk])) - (define (os-big-bang initial-state . initial-actions) (lambda () (transition->os-transition (world (void) (hash))