;;;; cl-scopes/core/message (defpackage :scopes/core/message (:use :common-lisp) (:local-nicknames (:actor :scopes/core/actor) (:shape :scopes/shape)) (:export #:message-meta #:message #:create #:head #:data)) (in-package :scopes/core/message) ;;;; message (defun message-meta () (make-instance 'shape:record-meta :head-fields '(:domain :action :class :item))) (defclass message (shape:record) ((shape:meta :initform (message-meta) :allocation :class) (actor:customer :accessor customer :initarg :customer :initform nil))) (defun create (head &key data customer) (shape:create 'message :head head :data data :customer customer)) (defmethod print-object ((msg message) stream) ;(shape:print-slots msg stream 'shape:head 'actor:customer 'shape:data) (format stream "#" (shape:head msg) (actor:customer msg) (shape:data msg)) ) (defmethod actor:content ((msg message)) (list (shape:head-plist msg) (shape:data msg)))