* 8sync/systems/actors (with-message-args): New macro.
(mlambda): Retool to use with-message-args as base.
;;; Actor utilities
;;; ===============
+
+(define-syntax-rule (with-message-args (message message-arg ...)
+ body body* ...)
+ (let ((message-arg (message-ref message (quote message-arg))) ...)
+ body body* ...))
+
(define-syntax mlambda
(syntax-rules ()
"A lambda for building message handlers.
((_ (actor message message-arg ...)
body body* ...)
(lambda (actor message)
- (let ((message-arg (message-ref message (quote message-arg))) ...)
- body body* ...)))))
+ (with-message-args (message message-arg ...) body body* ...)))))
;; @@: Sadly, docstrings won't work with this...
;; I think we need to bust out syntax-case to make that happen...