jolt/jolt-core/clojure/core
Yogthos d0e1a11934 Checked narrow casts; fix runtime require in self-contained-built binaries
byte/short/int/long/char silently wrapped or passed out-of-range values
through; the JVM range-checks (RT.byteCast family). One checked-cast
helper now carries the ranges: a double range-checks ITSELF before
truncating ((byte 1.1) is 1, (byte 127.000001) throws), NaN casts to 0,
ratios and bigdecs truncate, a non-number is CCE, and the throw carries
the JVM message. float range-checks against Float/MAX_VALUE. The
unchecked-* casts now genuinely wrap and sign-fold ((unchecked-byte 200)
is -56 — the old bit-and lost the sign) with doubles saturating like
Java's conversions; unchecked-long/int are host natives. double/float of
a bigdec convert instead of crashing. The no-single-float residue stays
accepted (SPEC.md).

Also fixes #290: a binary built by the SELF-CONTAINED joltc died with
'variable var-deref is not bound' when a namespace loaded at runtime.
The in-process build compiled flat.ss against a clean copy-environment,
which orphans every top-level define in locations the binary's runtime
eval can't see. It now compiles against the default interaction
environment (defines land in the real symbol cells, same as the legacy
fresh-Chez path) and a generated prologue pre-binds each kernel name the
runtime redefines to its kernel value, so the earliest boot reads match
the legacy path's primitive references. requiring-resolve is implemented
(the issue's dynamic-require pattern), and the release workflow smokes a
runtime require in a built binary.

Cast namespaces byte/short/int/long/char now fully clean; cts baseline
5805 -> 5857 pass, 67 baselined namespaces. 7 JVM-certified corpus rows.
2026-07-02 09:42:06 -04:00
..
00-kernel.clj Migrate clojure.core/set from a native shim to the kernel overlay tier 2026-06-30 10:35:57 -04:00
00-syntax.clj Fix six JVM divergences surfaced by rewrite-clj 2026-07-01 12:25:05 -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 Hierarchy fns follow the reference contracts; deftype classes join the class graph 2026-07-02 08:48:30 -04:00
21-coll.clj Numbers-style category dispatch for binary numeric ops 2026-07-02 06:41:45 -04:00
22-coll.clj Checked narrow casts; fix runtime require in self-contained-built binaries 2026-07-02 09:42:06 -04: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 Numbers-style category dispatch for binary numeric ops 2026-07-02 06:41:45 -04: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