27 lines
829 B
Common Lisp
27 lines
829 B
Common Lisp
;;;; 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 actor:message)
|
|
((shape:meta :initform (message-meta) :allocation :class)))
|
|
|
|
(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))
|
|
|
|
(defmethod actor:content ((msg message))
|
|
(list (shape:head-plist) (shape:data)))
|