jolt/jolt-core/clojure/core
Yogthos 448611a5df Match Clojure's lazy seq realization model
jolt's seq layer realized one element ahead of Clojure, so a side-effecting
lazy seq ran its producer too eagerly. Four changes bring it in line:

- rest is Clojure's more(): it returns the tail without realizing it. An
  unforced tail (vector / string / lazy-seq cell) comes back as a deferred
  seq, so (rest (iterate f x)) does not call f. next still realizes one.
- iterate applies f lazily, inside the tail thunk, so (first (iterate f x))
  is x with no call to f (clojure.lang.Iterate parity).
- take realizes exactly n: the last element terminates without touching the
  rest, instead of forcing one more element of the source.
- an empty realized lazy seq is still a sequence value, printing "()" not
  "nil" (a JVM LazySeq is never nil).

Also: the map transducer's step fn now takes multiple inputs
([result input & inputs]) so a multi-collection transduce applies f across
all of them. Fixes medley's join/window/sequence-padded laziness and
multi-input transducer tests (now 293/293). The rest change also fixed a
latent overrun in distinct/dedupe over a map's empty tail.

iterate is a seed source, re-minted.
2026-06-26 19:41:02 -04:00
..
00-kernel.clj Host interop fixes: ==/time/subvec/defonce + corpus cleanup 2026-06-21 15:36:41 -04:00
00-syntax.clj defn docstrings, assert throws AssertionError, Seqable covers collections 2026-06-25 17:23:24 -04:00
10-seq.clj Clean up codebase: rename stdlib layer, strip porting residue, fix tooling 2026-06-22 22:18:00 -04:00
20-coll.clj Class/forName honesty + class/isa? conformance for builtins (#243) 2026-06-26 21:02:44 +00:00
21-coll.clj Group the JVM interop shims under host/chez/java/ 2026-06-25 18:35:44 -04:00
22-coll.clj Collection fns: JVM-faithful return types + laziness (#219) 2026-06-26 03:01:36 +00:00
25-sorted.clj Clean up codebase: rename stdlib layer, strip porting residue, fix tooling 2026-06-22 22:18:00 -04:00
30-macros.clj Fixed-arity protocol dispatch shims (#223) 2026-06-26 05:57:42 +00:00
40-lazy.clj Match Clojure's lazy seq realization model 2026-06-26 19:41:02 -04:00
50-io.clj type returns the JVM class (Clojure semantics) (#244) 2026-06-26 21:14:06 +00:00