sdfsdfs
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
[emptyhead.util.magic :as magic]
|
||||
[clojure.set :refer [union]]))
|
||||
|
||||
(defn register-extension
|
||||
(defn register-extension!
|
||||
"Register `thought` as extension for one or more `stages`."
|
||||
[thought & stages]
|
||||
(doseq [stage stages]
|
||||
@@ -20,7 +20,7 @@
|
||||
(prop/remove-property! thought (magic/extension-prop stage)))
|
||||
thought)
|
||||
|
||||
(defn- get-extensions
|
||||
(defn get-extensions
|
||||
"Get extensions for `stage`;
|
||||
e.g. for `stage` of [:foo :bar :baz], get extensions for [:foo :bar :baz], [:foo :bar], [:foo]"
|
||||
[stage]
|
||||
@@ -31,6 +31,7 @@
|
||||
(recur (butlast property-segment)
|
||||
(union acc (prop/with-property (magic/extension-prop property-segment)))))))
|
||||
|
||||
;; XXX contains references to scrapped "contract" subsys
|
||||
(defn extensions
|
||||
"Get extensions of `thought`.
|
||||
Returns a map of {stage => #{thought}}."
|
||||
@@ -50,6 +51,10 @@
|
||||
(let [stages (thought/stages thought)
|
||||
aspects (filter #(contract/evaluate (thought/contract thought) %)
|
||||
(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)]
|
||||
(list aspects modified)))
|
||||
|
Reference in New Issue
Block a user