From 9cf2e4476c83f7a0f95f77b5cc8116520c376237 Mon Sep 17 00:00:00 2001 From: apt-get Date: Tue, 19 Aug 2025 23:48:31 +0200 Subject: [PATCH] fix broken stuff --- src/cljs/emptyhead/thought/eval.cljs | 6 ++++-- src/cljs/emptyhead/thought/return.cljs | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/cljs/emptyhead/thought/eval.cljs b/src/cljs/emptyhead/thought/eval.cljs index 8cabd65..98d5cb3 100644 --- a/src/cljs/emptyhead/thought/eval.cljs +++ b/src/cljs/emptyhead/thought/eval.cljs @@ -14,12 +14,14 @@ (if-not impl-idea (logging/error (str "No implementation for thought `" (thought/operator 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! "Execute `thought` with `parent`, applying aspects to `thought` according to its :extension-stages. Returns (potentially modified) `parent`." - [thought parent] + [thought & [parent]] (loop [th (prtc/val-fn #(assoc % :_parent (prtc/value parent)) thought) parent parent] (let [[extensions th cur] (extend/pop-stage th) diff --git a/src/cljs/emptyhead/thought/return.cljs b/src/cljs/emptyhead/thought/return.cljs index e666311..22a54c5 100644 --- a/src/cljs/emptyhead/thought/return.cljs +++ b/src/cljs/emptyhead/thought/return.cljs @@ -3,11 +3,11 @@ (:require [emptyhead.idea.protocol :as prtc])) (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." [thought data] (if (first data) - (prtc/copy-fn + (prtc/val-fn #(update % :return (fnil into []) data) thought) thought))