diff --git a/csys/csys.lisp b/csys/csys.lisp index 43d286c..7479b6a 100644 --- a/csys/csys.lisp +++ b/csys/csys.lisp @@ -8,7 +8,8 @@ (:shape :scopes/shape) (:util :scopes/util) (:alx :alexandria)) - (:export #:scope #:environ + (:export #:*domain* + #:scope #:environ #:make-program #:create-zero #:neuron #:std-proc #:eff-proc #:handle-action #:basic-actions #:forward #:notify @@ -18,6 +19,8 @@ (in-package :scopes/csys) +(defvar *domain* :csys) + ;;;; scope: information a neuron has access to (defclass scope () @@ -192,7 +195,7 @@ (defun send-message (cell head data) (actor:send cell (message:create head :data data))) -(defun send-create (cell &rest args &key (domain :csys) +(defun send-create (cell &rest args &key (domain *domain*) (cat :c00) loc connect op &allow-other-keys) (let ((args+ (if loc `(:addr ,(list domain cat loc)) @@ -200,7 +203,7 @@ (setf args (alx:remove-from-plist args :domain :cat :loc)) (send-message cell (list domain :create) (append args+ args)))) -(defun send-connect (cell target &key op (domain :csys)) +(defun send-connect (cell target &key op (domain *domain*)) (send-message cell (list domain :connect) (list :target target :op op))) (defun printer () diff --git a/csys/environ.lisp b/csys/environ.lisp index da06583..4ce754c 100644 --- a/csys/environ.lisp +++ b/csys/environ.lisp @@ -30,7 +30,7 @@ (defun simple-setup (cfg) (destructuring-bind (prg &key (zero-cat :c00) eff-contacts) cfg (let ((env (create #'simple-proc (csys:printer) :eff-contacts eff-contacts))) - (csys:create-zero prg env :categ (list :csys zero-cat)) + (csys:create-zero prg env :categ (list csys:*domain* zero-cat)) env))) (defun simple-proc (msg scope) @@ -101,11 +101,11 @@ ;;;; public shortcuts -(defun send-value (cat-loc val &key (domain :csys) (env *env*)) +(defun send-value (cat-loc val &key (domain csys:*domain*) (env *env*)) (let ((head (cons domain (cons :value cat-loc)))) (actor:send env (message:create head :data `(:value ,val))))) -(defun send-connect (env &rest args &key (domain :csys) addr to target op) +(defun send-connect (env &rest args &key (domain csys:*domain*) addr to target op) (let ((head (list domain :connect))) (actor:send env (message:create head :data args))))