diff --git a/core/actor.lisp b/core/actor.lisp index 3d2fcb5..092635a 100644 --- a/core/actor.lisp +++ b/core/actor.lisp @@ -6,7 +6,7 @@ (:shape :scopes/shape) (:util :scopes/util)) (:export #:start #:stop #:create #:send - #:message #:content #:customer + #:message #:content #:customer #:set-content #:*logger* #:*root* #:echo #:inc #:lgi #:calculator #:plus #:minus #:show #:send-value)) @@ -31,6 +31,11 @@ (defun message (content &optional customer) (make-instance 'message :content content :customer customer)) +(defgeneric set-content (msg fn) + (:method (msg fn) (funcall fn msg)) + (:method ((msg message) fn) + (message (funcall fn (content msg)) (customer msg)))) + ;;;; actor loop (listener) (eval-when (:compile-toplevel :load-toplevel :execute)