From c04546ffe75020b77e6bfaa9017f10c3cb5c6d95 Mon Sep 17 00:00:00 2001 From: Helmut Merz Date: Thu, 26 Mar 2026 16:27:42 +0100 Subject: [PATCH] csys: provide generic functions for accessing neuron state --- csys/csys.lisp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/csys/csys.lisp b/csys/csys.lisp index 7db4da8..cbf7b4a 100644 --- a/csys/csys.lisp +++ b/csys/csys.lisp @@ -3,9 +3,7 @@ (defpackage :scopes/csys (:use :common-lisp) (:local-nicknames (:actor :scopes/core/actor) - (:async :scopes/util/async) (:config :scopes/config) - (:core :scopes/core) (:message :scopes/core/message) (:shape :scopes/shape) (:util :scopes/util) @@ -61,7 +59,15 @@ (destructuring-bind (nmsg nst nsyns) (handle-action msg state syns env :default #'remember) (forward nmsg nsyns) - (update-neuron #'std-proc nst nsyns env))) + (update-neuron (next-proc nst) nst nsyns env))) + +;;;; neuron state methods + +(defgeneric next-proc (state &optional default) + (:method (state &optional (default #'std-proc)) default)) + +(defgeneric value (state) + (:method (state) state)) ;;;; sensors: neurons receiving messages from environment, addressable via message head @@ -78,7 +84,7 @@ ;(util:lgi key sns) sns)) -;;;; effectors: pseudo-neurons embedded in environment +;;;; effector procs for pseudo-neurons embedded in environment (defun do-log (msg state syns env) (util:lgi msg))