diff --git a/csys.lisp b/csys.lisp index 34a32c7..295d468 100644 --- a/csys.lisp +++ b/csys.lisp @@ -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)))) diff --git a/test-csys.lisp b/test-csys.lisp index 5513d3b..0f6ea88 100644 --- a/test-csys.lisp +++ b/test-csys.lisp @@ -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) + )) diff --git a/test-decons.lisp b/test-decons.lisp index 9e92976..7b1ddc1 100644 --- a/test-decons.lisp +++ b/test-decons.lisp @@ -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)