diff --git a/prospect/actor.rkt b/prospect/actor.rkt index f6dbaf2..4d7e8de 100644 --- a/prospect/actor.rkt +++ b/prospect/actor.rkt @@ -13,6 +13,7 @@ send! return! return/no-link-result! + perform-core-action! ;; forall @@ -83,9 +84,9 @@ ;; ;; Patch Instructions are issued when the actor uses `assert!` and ;; `retract!`. Action instructions are issued when the actor uses -;; `do!`, and return instructions when `return!` is called. -;; Script-complete instructions are automatically issued when a Script -;; terminates successfully. +;; `perform-core-action!`, and return instructions when `return!` is +;; called. Script-complete instructions are automatically issued when +;; a Script terminates successfully. ;; ;; Spawn instructions are issued when `actor`, `network`, and `state` ;; are used, directly or indirectly. (TODO: `background`?) The @@ -184,10 +185,10 @@ ;; Returns void (define (send! M #:meta-level [meta-level 0]) - (do! (message (prepend-at-meta M meta-level)))) + (perform-core-action! (message (prepend-at-meta M meta-level)))) ;; Returns void -(define (do! A) +(define (perform-core-action! A) (call-in-raw-context (lambda (k) (action-instruction A k)))) @@ -248,7 +249,7 @@ (expand-state 'network #'(I ... - (do! (quit-world)) + (perform-core-action! (quit-world)) (return/no-link-result!)) #'() #'() @@ -390,7 +391,6 @@ ;; Compilation of HLL actors ;; TODO: track -;; TODO: clean way of spawning low-level actors from hll ;; TODO: default to hll (begin-for-syntax diff --git a/prospect/examples/actor/chat.rkt b/prospect/examples/actor/chat.rkt index ae497a2..b03e2e1 100644 --- a/prospect/examples/actor/chat.rkt +++ b/prospect/examples/actor/chat.rkt @@ -34,12 +34,12 @@ (send! (shutdown)) (send! (says user input-string))))))) -(spawn-tcp-driver) - (%%boot (lambda () (actor + (perform-core-action! (spawn-tcp-driver)) + (network (define us (tcp-listener 5000)) (until (message (shutdown)) (assert (advertise (observe (tcp-channel _ us _))) #:meta-level 1) diff --git a/prospect/examples/actor/file-system.rkt b/prospect/examples/actor/file-system.rkt index 55b7b71..e423f5e 100644 --- a/prospect/examples/actor/file-system.rkt +++ b/prospect/examples/actor/file-system.rkt @@ -10,12 +10,12 @@ (struct save (file) #:prefab) (struct delete (name) #:prefab) -(spawn-timer-driver) - (%%boot (lambda () (actor + (perform-core-action! (spawn-timer-driver)) + (actor (forever #:collect [(files (hash))] (on (asserted (observe (file $name _))) (printf "At least one reader exists for ~v\n" name)