Compare commits

...

2 Commits

Author SHA1 Message Date
9cf2e4476c fix broken stuff 2025-08-19 23:48:31 +02:00
1bb55f4d36 add missing func back 2025-08-19 23:08:50 +02:00
3 changed files with 11 additions and 4 deletions

View File

@@ -14,12 +14,14 @@
(if-not impl-idea (if-not impl-idea
(logging/error (str "No implementation for thought `" (thought/operator thought) "`.") (logging/error (str "No implementation for thought `" (thought/operator thought) "`.")
{:thought thought :parent parent :type :unimplemented-thought}) {:thought thought :parent parent :type :unimplemented-thought})
((:implementation impl-idea) thought parent)))) ((prtc/val-fn :implementation impl-idea) thought parent))))
;; FIXME I don't think omitting the parent here is actually valid?
;; might need to use thought.crud/root-thought, but better making parent mandatory tabun
(defn execute! (defn execute!
"Execute `thought` with `parent`, applying aspects to `thought` according to its :extension-stages. "Execute `thought` with `parent`, applying aspects to `thought` according to its :extension-stages.
Returns (potentially modified) `parent`." Returns (potentially modified) `parent`."
[thought parent] [thought & [parent]]
(loop [th (prtc/val-fn #(assoc % :_parent (prtc/value parent)) thought) (loop [th (prtc/val-fn #(assoc % :_parent (prtc/value parent)) thought)
parent parent] parent parent]
(let [[extensions th cur] (extend/pop-stage th) (let [[extensions th cur] (extend/pop-stage th)

View File

@@ -3,11 +3,11 @@
(:require [emptyhead.idea.protocol :as prtc])) (:require [emptyhead.idea.protocol :as prtc]))
(defn with-return (defn with-return
"Returns a copy of the thought with all values in data "Returns the thought with all values in data
added to the top of its stack." added to the top of its stack."
[thought data] [thought data]
(if (first data) (if (first data)
(prtc/copy-fn (prtc/val-fn
#(update % :return (fnil into []) data) thought) #(update % :return (fnil into []) data) thought)
thought)) thought))

View File

@@ -9,5 +9,10 @@
(defn thought-impl-prop [operator] (defn thought-impl-prop [operator]
(conj thought-impl-ns operator)) (conj thought-impl-ns operator))
(def extension-ns (conj thought-ns :extends))
(defn extension-prop [stage]
(conj extension-ns stage))
(defn symbolize-ns [ns] (defn symbolize-ns [ns]
(str/join "." (map name ns))) (str/join "." (map name ns)))