start with 'testing' neuron

This commit is contained in:
Helmut Merz 2025-06-04 21:05:59 +02:00
parent 5cc56955a3
commit 0865fa9e65
3 changed files with 18 additions and 5 deletions

View file

@ -4,10 +4,14 @@
(:use :common-lisp)
(:local-nicknames (:actor :scopes/core/actor)
(:util :scopes/util))
(:export #:cell #:system))
(:export #:neuron #:synapse))
(in-package :decons/csys)
(defun cell (mh &key state conns)
(defun neuron (proc &key state syns)
(actor:create
(lambda (msg) (funcall mh state conns))))
(lambda (msg) (funcall proc msg state syns))))
(defun synapse (rcvr &optional (op #'identity))
(lambda (msg)
(actor:send rcvr (op msg))))

View file

@ -2,5 +2,13 @@
(in-package :decons/test-decons)
(defun probe (msg state syns)
(let ((t:*test-suite* state))
(== (actor:content msg) 42)))
(deftest test-neuron ()
(== 1 1))
(let ((prb (csys:neuron #'probe :state t:*test-suite*)))
(actor:send prb (actor:message 42))
(sleep 0.2)
(actor:stop prb)
))

View file

@ -2,7 +2,8 @@
(defpackage :decons/test-decons
(:use :common-lisp)
(:local-nicknames (:csys :decons/csys)
(:local-nicknames (:actor :scopes/core/actor)
(:csys :decons/csys)
(:mlx :decons/mlx)
(:r :decons/recurse)
(:xplore :decons/xplore)