work in progress: environ:forward
This commit is contained in:
parent
e816a13d41
commit
877f23a5d4
2 changed files with 12 additions and 10 deletions
|
|
@ -23,7 +23,7 @@
|
|||
(stage :accessor stage :initform :initial)
|
||||
(proc :accessor proc :initarg :proc :initform #'std-proc)
|
||||
(program :reader program :initarg :program :initform nil)
|
||||
(actions :reader actions :initarg :actions :initform nil)
|
||||
(actions :accessor actions :initarg :actions :initform nil)
|
||||
(syns :accessor syns :initform nil)
|
||||
(environ :reader environ :initarg :environ)))
|
||||
|
||||
|
|
@ -31,7 +31,10 @@
|
|||
(apply #'make-instance 'scope :program program args))
|
||||
|
||||
(defun reset-scope (scope &rest args)
|
||||
(apply #'scope (program scope) :environ (environ scope) args))
|
||||
(apply #'scope (or (getf args :program) (program scope))
|
||||
:categ (or (getf args :categ) (categ scope))
|
||||
:environ (or (getf args :environ) (environ scope))
|
||||
args))
|
||||
|
||||
;;;; neurons (= async tasks) and synapses (= connections)
|
||||
|
||||
|
|
@ -58,8 +61,7 @@
|
|||
(update nscope)))
|
||||
|
||||
(defun create (msg scope)
|
||||
;todo: use message data for modifying new scope
|
||||
(let ((new (neuron (reset scope))))
|
||||
(let ((new (neuron (apply #'reset scope (shape:data msg)))))
|
||||
(notify-created msg new scope)))
|
||||
|
||||
(defun do-log (msg scope)
|
||||
|
|
|
|||
|
|
@ -6,15 +6,15 @@
|
|||
(:csys :scopes/csys)
|
||||
(:message :scopes/core/message)
|
||||
)
|
||||
(:export #:send #:send-message)
|
||||
(:export #:forward #:forward-message)
|
||||
)
|
||||
|
||||
(in-package :scopes/csys/environ)
|
||||
|
||||
(defun send-message (head data &key customer)
|
||||
(send (message:create head :data data :customer customer)))
|
||||
(defun forward-message (head scope &key data customer)
|
||||
(forward (message:create head :data data :customer customer) scope))
|
||||
|
||||
(defun send (msg)
|
||||
(dolist (sn (find-sensors msg))
|
||||
(actor:send sn msg)))
|
||||
(defun forward (msg scope)
|
||||
(dolist (cell (find-cells (message:addr msg) scope))
|
||||
(actor:send cell msg)))
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue