Step 5 final: revert trampoline to Janet native

Overlay trampoline fails arity dispatch — (trampoline f 5) with [f]
and [f & args] arities dispatches incorrectly in Jolt. The Janet
core-trampoline is 4 lines and works correctly. Kept native.

Results: 22/22 lazy-infinite, 229x3 conformance, 32/32 specs.
This commit is contained in:
Yogthos 2026-06-08 11:12:00 -04:00
parent 48ce42d94d
commit 68639e8911
2 changed files with 4 additions and 11 deletions

View file

@ -209,17 +209,6 @@
(defn rationalize [x] x)
;; trampoline: repeatedly calls f with args until a non-function result.
(defn trampoline
([f]
(let [ret (f)]
(if (ifn? ret)
(recur ret)
ret)))
([f & args]
(let [ret (apply f args)]
(if (ifn? ret)
(recur ret)
ret))))
;; rand-int: random integer in [0, n). Uses Janet math/random.

View file

@ -1404,6 +1404,10 @@
# subvec lives in the Clojure kernel tier — core/00-kernel.clj.
(defn core-trampoline [f & args]
(var result (apply f args))
(while (function? result) (set result (result)))
result)
(def core-format (fn [fmt & args] (string/format fmt ;args)))
# ============================================================