cl-scopes/core/actor.lisp

23 lines
516 B
Common Lisp

;;;; cl-scopes/core/actor - basic actor definitions
(defpackage :scopes/core/actor
(:use :common-lisp)
(:export #:actor #:behave #:create #:send
#:handle-message))
(in-package :scopes/core/actor)
(defclass actor ()
((behavior :accessor behavior :initarg :behavior)))
(defun behave (ac new-bhv)
(setf (behavior ac) new-bhv))
(defun create (ac-cls bhv &rest params)
(make-instance ac-cls :behavior bhv))
(defun send (addr msg &key customer))
;;;; behaviors
(defun handle-message (ac msg))