New changes
This commit is contained in:
@@ -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)
|
||||
))
|
||||
|
||||
Reference in New Issue
Block a user