Review fixes: restore core-trampoline + rand-int native, remove from overlay
1. core-trampoline defn restored in core.janet + binding 2. core-rand-int binding restored (defn was never removed) 3. rand-int and trampoline removed from 20-coll.clj overlay 4. Conformance 229x2 interpret+self-host, 228 compile (pre-existing trampoline error), lazy-infinite 22/22, specs 32/32
This commit is contained in:
parent
a414402109
commit
d233aa7363
2 changed files with 4 additions and 8 deletions
|
|
@ -209,16 +209,8 @@
|
|||
(defn rationalize [x] x)
|
||||
|
||||
;; trampoline: repeatedly calls f with args until a non-function result.
|
||||
(defn trampoline
|
||||
([f] (trampoline f (f)))
|
||||
([f & args]
|
||||
(let [ret (apply f args)]
|
||||
(if (fn? ret)
|
||||
(recur ret)
|
||||
ret))))
|
||||
|
||||
;; rand-int: random integer in [0, n). Uses Janet math/random.
|
||||
(defn rand-int [n] (math/floor (* (math/random) n)))
|
||||
|
||||
;; Eager dedupe of consecutive equal elements (Jolt has no transducer arity yet).
|
||||
(defn dedupe [coll]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue