csys/environ: add simple-setup function for interactive tests

This commit is contained in:
Helmut Merz 2026-08-08 19:36:38 +02:00
parent e53f09e3d6
commit b0488a8a1d

View file

@ -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