From 3d0cbed3c55471dd500f42b9f370e152638c1ce5 Mon Sep 17 00:00:00 2001 From: Yogthos Date: Tue, 30 Jun 2026 10:27:27 -0400 Subject: [PATCH] Remove dead native transduce shim (overlay already provides it) The overlay defines transduce in clojure/core/22-coll.clj as a pure composition (xf (reduce xf init coll)), and it shadows the native jolt-transduce by load order. The compiled overlay version is already what gets baked into the seed, so the native binding in natives-transduce.ss was dead weight. transduce is not used by the self-hosted compiler and no overlay tier before 22-coll references it, so removing the native binding is safe. Re-minting produces a byte-identical seed, which proves the runtime is unchanged. sequence stays native (its transformer iterator drives the reduced box and lazy realization directly). --- host/chez/natives-transduce.ss | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/host/chez/natives-transduce.ss b/host/chez/natives-transduce.ss index 79e87bb..3034b4f 100644 --- a/host/chez/natives-transduce.ss +++ b/host/chez/natives-transduce.ss @@ -25,18 +25,11 @@ (def-var! "clojure.core" "volatile!" jolt-volatile!) (def-var! "clojure.core" "deref" jolt-deref) -;; --- transduce / sequence ---------------------------------------------------- -;; (transduce xform f coll) / (transduce xform f init coll): build the transformed -;; reducing fn (xform f), reduce it over coll (reduce-seq honors `reduced`), then -;; run the completion (1-arg) arity. The 3-arg init defaults to (f) — the rf's -;; 0-arity, e.g. (+) = 0, (conj) = []. -(define jolt-transduce - (case-lambda - ((xform f coll) (jolt-transduce xform f (jolt-invoke f) coll)) - ((xform f init coll) - (let* ((xf (jolt-invoke xform f)) - (res (reduce-seq xf init (jolt-seq coll)))) - (jolt-invoke xf res))))) +;; --- sequence ---------------------------------------------------------------- +;; transduce lives in the overlay (clojure/core/22-coll.clj): it's a pure +;; composition (xf (reduce xf init coll)) over reduce, so the Clojure version +;; lowers to the same code the native shim did. sequence stays native (below): +;; its transformer iterator drives the reduced box + lazy realization directly. ;; (sequence coll) -> a seq; (sequence xform coll) -> a LAZY seq of coll transformed ;; by xform. A transformer iterator (mirrors clojure.core's TransformerIterator): @@ -87,7 +80,6 @@ ((coll) (jolt-seq coll)) ((xform coll) (sequence-xf xform coll)))) -(def-var! "clojure.core" "transduce" jolt-transduce) (def-var! "clojure.core" "sequence" jolt-sequence) ;; --- cat ---------------------------------------------------------------------