code cleanup

This commit is contained in:
2025-08-06 21:02:44 +02:00
parent 8040c7f7a6
commit d278185ff3
19 changed files with 21 additions and 226 deletions

View File

@@ -37,26 +37,19 @@
Returns a map of {stage => #{thought}}."
[thought]
(let [stages (thought/stages thought)
filter-fn #(contract/evaluate (thought/contract thought) %)
aspects (map
#(->> % get-extensions (filter filter-fn))
stages)]
aspects (map get-extensions stages)]
(zipmap stages aspects)))
(defn pop-stage
"Get aspects of next stage of thought execution.
Returns a tuple of (#{extension-dhammas},
Returns a tuple of (#{extensions},
a copy of `thought` with its first extension-stage removed)."
[thought]
(let [stages (thought/stages thought)
aspects (filter #(contract/evaluate (thought/contract thought) %)
(get-extensions (first stages)))
aspects (get-extensions (first stages))
;; FIXME idk why this was here, but it's wrong--
;; I've commented it out now, probably breaks something elsewhere!
;; aspects (prop/with-property (magic/extension-prop (first stages)))
modified (prtc/copy-fn #(assoc % :ext-stages (rest stages))
thought)]
thought)]
(list aspects modified)))
(defn has-stage?