Expose `perform-core-action!`.

This commit is contained in:
Tony Garnock-Jones 2015-12-12 06:52:16 +13:00
parent bd0278297b
commit 97dceedff2
3 changed files with 11 additions and 11 deletions

View File

@ -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

View File

@ -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)

View File

@ -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)