summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
5d45fbc)
* 8sync/systems/actors.scm (msg-receive): Add docstring, and change
parameter name from "the-message" to just "message".
(msg-val): New procedure.
<- <-wait <-reply <-reply-wait
<- <-wait <-reply <-reply-wait
- call-with-message msg-receive
+ call-with-message msg-receive msg-val
ez-run-hive
bootstrap-message
ez-run-hive
bootstrap-message
;; Emacs: (put 'msg-receive 'scheme-indent-function 2)
;; @@: Or receive-msg or receieve-message or??
;; Emacs: (put 'msg-receive 'scheme-indent-function 2)
;; @@: Or receive-msg or receieve-message or??
-(define-syntax-rule (msg-receive arglist the-message body ...)
- (call-with-message the-message
+(define-syntax-rule (msg-receive arglist message body ...)
+ "Call body with arglist (which can accept arguments like lambda*)
+applied from the message-body of message."
+ (call-with-message message
(lambda* arglist
body ...)))
(lambda* arglist
body ...)))
+(define (msg-val message)
+ "Retrieve the first value from the message-body of message.
+Like single value return from a procedure call. Probably the most
+common case when waiting on a reply from some action invocation."
+ (call-with-message message
+ (lambda (_ val) val)))
+
\f
;;; Various API methods for actors to interact with the system
;;; ==========================================================
\f
;;; Various API methods for actors to interact with the system
;;; ==========================================================