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)
|
(stage :accessor stage :initform :initial)
|
||||||
(proc :accessor proc :initarg :proc :initform #'std-proc)
|
(proc :accessor proc :initarg :proc :initform #'std-proc)
|
||||||
(program :reader program :initarg :program :initform nil)
|
(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)
|
(syns :accessor syns :initform nil)
|
||||||
(environ :reader environ :initarg :environ)))
|
(environ :reader environ :initarg :environ)))
|
||||||
|
|
||||||
|
|
@ -31,7 +31,10 @@
|
||||||
(apply #'make-instance 'scope :program program args))
|
(apply #'make-instance 'scope :program program args))
|
||||||
|
|
||||||
(defun reset-scope (scope &rest 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)
|
;;;; neurons (= async tasks) and synapses (= connections)
|
||||||
|
|
||||||
|
|
@ -58,8 +61,7 @@
|
||||||
(update nscope)))
|
(update nscope)))
|
||||||
|
|
||||||
(defun create (msg scope)
|
(defun create (msg scope)
|
||||||
;todo: use message data for modifying new scope
|
(let ((new (neuron (apply #'reset scope (shape:data msg)))))
|
||||||
(let ((new (neuron (reset scope))))
|
|
||||||
(notify-created msg new scope)))
|
(notify-created msg new scope)))
|
||||||
|
|
||||||
(defun do-log (msg scope)
|
(defun do-log (msg scope)
|
||||||
|
|
|
||||||
|
|
@ -6,15 +6,15 @@
|
||||||
(:csys :scopes/csys)
|
(:csys :scopes/csys)
|
||||||
(:message :scopes/core/message)
|
(:message :scopes/core/message)
|
||||||
)
|
)
|
||||||
(:export #:send #:send-message)
|
(:export #:forward #:forward-message)
|
||||||
)
|
)
|
||||||
|
|
||||||
(in-package :scopes/csys/environ)
|
(in-package :scopes/csys/environ)
|
||||||
|
|
||||||
(defun send-message (head data &key customer)
|
(defun forward-message (head scope &key data customer)
|
||||||
(send (message:create head :data data :customer customer)))
|
(forward (message:create head :data data :customer customer) scope))
|
||||||
|
|
||||||
(defun send (msg)
|
(defun forward (msg scope)
|
||||||
(dolist (sn (find-sensors msg))
|
(dolist (cell (find-cells (message:addr msg) scope))
|
||||||
(actor:send sn msg)))
|
(actor:send cell msg)))
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue