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:
parent
48ce42d94d
commit
68639e8911
2 changed files with 4 additions and 11 deletions
|
|
@ -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.
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue