jolt/stdlib/clojure
Yogthos 77e80dab9c Fix six JVM divergences surfaced by rewrite-clj
Running the rewrite-clj test suite under jolt exposed six bugs, each fixed here:

- `for`/`doseq` `:let` bindings never went through `destructure`, so a
  destructuring pattern (`:let [{:keys [y]} x]`) hit `let*` raw and failed to
  compile. Emit `let`, like Clojure.
- `with-open` couldn't close a deftype/defrecord that implements a `close` method
  (java.io.Closeable / AutoCloseable, e.g. tools.reader's readers) — `__close`
  only knew jhost readers and map `:close` fns. Dispatch a record's `close`.
- A deftype/defrecord method param named like a field didn't shadow the field
  (the field's let-binding wrapped the params). Params now shadow, as in Clojure.
- A deftype whose simple name collided with a built-in host class clobbered it in
  the global ctor table, so `(java.io.PushbackReader. …)` built tools.reader's
  same-named deftype. Register deftypes/built-ins by FQN, don't let a deftype
  overwrite a built-in's simple name, and qualify a bare `(Name. …)` to the
  deftype's FQN only in the ns that defined it.
- `clojure.walk` was lazy over a non-list seq (missing `doall`), so a walk whose
  fn has side effects read stale state. Make it eager, like Clojure.
- `Character/isWhitespace` used an ASCII-only check that missed U+2028 and other
  Unicode whitespace. Use the JVM's Unicode set (minus the no-break spaces it
  excludes).

Regressions: corpus rows (for-let destructure, method-param shadow, walk eager,
isWhitespace), a unit row (with-open closes a record), and smoke checks (the
class-name collision, run in a fresh -e process so the deftype doesn't leak).

One divergence remains unfixed: a submatch from a losing regex alternation branch
leaks when the winning branch has a quantified group (a bug in the vendored
irregex engine, not jolt) — tracked separately.
2026-07-01 12:25:05 -04:00
..
core core.async: higher-level API over native channels + two general fixes 2026-06-27 13:05:19 -04:00
sci Clean up codebase: rename stdlib layer, strip porting residue, fix tooling 2026-06-22 22:18:00 -04:00
data.clj Clean up codebase: rename stdlib layer, strip porting residue, fix tooling 2026-06-22 22:18:00 -04:00
edn.clj edn: read raw forms so a #tag goes through :readers/:default 2026-06-27 01:15:33 -04:00
pprint.clj Port real clojure.pprint (pretty-printer + cl-format) 2026-06-24 16:09:09 -04:00
set.clj deftype/record: clojure.lang collection interfaces + protocol identity 2026-06-25 00:14:19 -04:00
string.clj Dead-code removal, perf fixes, deterministic seed emission 2026-06-23 01:05:45 -04:00
template.clj Run core.memoize's test suite on jolt 2026-06-25 13:23:05 -04:00
test.clj Compile data readers that return code forms 2026-07-01 10:57:55 -04:00
walk.clj Fix six JVM divergences surfaced by rewrite-clj 2026-07-01 12:25:05 -04:00
zip.clj data.zip: add clojure.zip/xml-zip; clojure.xml lives in jolt-lang/xml 2026-06-27 14:49:49 -04:00