csys/environ: add simple-setup function for interactive tests
This commit is contained in:
parent
e53f09e3d6
commit
b0488a8a1d
1 changed files with 8 additions and 2 deletions
|
|
@ -9,7 +9,7 @@
|
||||||
(:shape :scopes/shape)
|
(:shape :scopes/shape)
|
||||||
(:util :scopes/util))
|
(:util :scopes/util))
|
||||||
(:export #:*env*
|
(:export #:*env*
|
||||||
#:create #:simple-proc
|
#:create #:simple-setup #:simple-proc
|
||||||
#:actions
|
#:actions
|
||||||
#:send-value #:send-connect))
|
#:send-value #:send-connect))
|
||||||
|
|
||||||
|
|
@ -27,12 +27,18 @@
|
||||||
(create-contact-cells eff-contacts env (cells scope))
|
(create-contact-cells eff-contacts env (cells scope))
|
||||||
env))
|
env))
|
||||||
|
|
||||||
|
(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))
|
||||||
|
env)))
|
||||||
|
|
||||||
(defun simple-proc (msg scope)
|
(defun simple-proc (msg scope)
|
||||||
(util:mv-bind (nmsg (scope scope))
|
(util:mv-bind (nmsg (scope scope))
|
||||||
(csys:handle-action msg scope :actions (actions))
|
(csys:handle-action msg scope :actions (actions))
|
||||||
(util:lgi msg nmsg)
|
(util:lgi msg nmsg)
|
||||||
(when nmsg
|
(when nmsg
|
||||||
(actor:send (env scope) nmsg))))
|
(actor:send (csys:environ scope) nmsg))))
|
||||||
|
|
||||||
;;;; eff contact cells
|
;;;; eff contact cells
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue