This commit is contained in:
2026-01-25 17:13:18 +01:00
3 changed files with 7 additions and 8 deletions

View File

@@ -9,7 +9,7 @@
(fn [_thought parent]
[parent nil]))
;; Container: Used for chaining multiple operations. Returns intself rather than its parent!
;; Container: Used for chaining multiple operations. Returns itself rather than its parent!
(def/define! [:EH :CORE :CONTAINER]
(fn [thought _parent]
[thought nil]))

View File

@@ -16,8 +16,8 @@
th (thought/register-thought! [:EH :IO :RETURN]
:data to
:reference (str "<" to "+_>"))]
(del/add-delegate th [:EH :PRIM :PARTIAL :+])
(extend/register-extension! th [th])
[parent th])))
;; Final addition, e.g. =(5 +) 5=.
@@ -29,7 +29,6 @@
:data [to from]
:reference (str "<" to "+" from ">"))]
(del/add-delegate th [:EH :LAZY [:EH :PRIM :NUM]])
(extend/register-extension! th [th])
[parent th])))
(def/define! [:EH :LAZY [:EH :PRIM :NUM] :REIFY]

View File

@@ -22,8 +22,8 @@
;; TODO Proper warnings when intend impl does not exist
(defn register-single-impl
"Wrapper around register-impl for singleton operators."
[to from impl]
(let [th (prtc/reference (thought/get-singleton impl))]
[to from impl-op]
(let [th (prtc/reference (thought/get-singleton impl-op))]
(register-impl to from th)))
(defn apply-ext
@@ -48,7 +48,7 @@
(second (thought/pop-stack (eval/execute! th)))))
(defn multi-msg
"Apply multiple messages sequentially. =(:foo :bar :baz)= <-> =((:foo :bar) :baz)."
"Apply multiple messages sequentially. =(:foo :bar :baz)= <-> =((:foo :bar) :baz)=."
[& msgs]
(reduce apply-msg msgs))
@@ -76,8 +76,8 @@
(def/define! [:EH :MSG :MATCH]
(fn [_thought parent]
(let [data (thought/data parent)
[to from] (map #(get-in data [:delegates %]) [(:to data) (:from data)])
stages (for [a to b from] [:EH :IMPL a b])
[to-dels from-dels] (map #(get-in data [:delegates %]) [(:to data) (:from data)])
stages (for [a to-dels b from-dels] [:EH :IMPL a b])
parent (assoc parent :ext-stages (vec stages))]
[parent nil])))