New changes

This commit is contained in:
2026-01-24 16:32:03 +01:00
parent 31d0cc4d26
commit 335377587b
5 changed files with 52 additions and 21 deletions

View File

@@ -14,6 +14,7 @@
(eval/execute! remover)))
;; FIXME Delegate order is currently undefined! Give this a proper order.
;; FIXME needs to be called with a list as second arg??
(defn add-delegate
"Register `del` as a delegate for `msg`: implementations defined for `del` will now run trigger on `msg` as well.
For instance, if message =(:foo :bar)= is defined and we =(add-delegate :quux :bar)= then =(:foo :quux)= will alias to =(:foo :bar)=.
@@ -31,6 +32,8 @@
(defn get-delegates
"Get possible delegates for `msg`."
[msg]
(let [stage [:EH :MSG :DELEGATE msg]]
(-> (thought/register-thought! [:EH :CORE :CONTAINER] :ext-stages [stage])
eval/execute! thought/pop-stack second)))
(let [stage [:EH :MSG :DELEGATE msg]
dels (-> (thought/register-thought! [:EH :CORE :CONTAINER] :ext-stages [stage])
eval/execute! thought/pop-stack second)]
(mapcat #(cons % (get-delegates %)) dels)
))