From 871c5ef5af6e69fff610898725b3625617a6fee6 Mon Sep 17 00:00:00 2001 From: Helmut Merz Date: Fri, 6 Jun 2025 20:36:41 +0200 Subject: [PATCH] prepare for additional functionality; step 1: simple numeric messages --- csys.lisp | 11 ++++++----- test-csys.lisp | 4 +++- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/csys.lisp b/csys.lisp index 4762994..364e9f1 100644 --- a/csys.lisp +++ b/csys.lisp @@ -6,7 +6,8 @@ (:util :scopes/util)) (:export #:neuron #:synapse #:forward - #:set-content)) + #:set-content + #:inhibit)) (in-package :decons/csys) @@ -24,9 +25,9 @@ (dolist (s syns) (funcall s msg))) -;;;; helpers for operating on messages +;;;; helpers for operations on complex messages (with content and customer slots) (defun set-content (fn) - (lambda (msg) (actor:message - (funcall fn (actor:content msg)) - (actor:customer msg)))) + (lambda (msg) (actor:set-content msg fn))) + +(defun inhibit () (set-content #'-)) diff --git a/test-csys.lisp b/test-csys.lisp index a339d25..4574877 100644 --- a/test-csys.lisp +++ b/test-csys.lisp @@ -10,7 +10,9 @@ (deftest test-neuron () (let* ((prb (csys:neuron #'probe :env t:*test-suite* :state '(43 44))) - (syn (csys:synapse prb (csys:set-content (lambda (c) (+ 1 c))))) + ;(syn (csys:synapse prb (csys:set-content #'1+))) + (syn (csys:synapse prb #'1+)) + ;(syn (csys:synapse prb (csys:inhibit))) (fw (csys:neuron #'csys:forward :syns (list syn)))) (actor:send fw 42) (actor:send fw 43)