Chez Phase 2: clojure.set + clojure.math + pprint (jolt-j5vg, jolt-22vo)
Close the remaining Phase-2 stdlib parity gaps. clojure.set: pure Clojure over core, so just added to the prelude stdlib tier (driver.janet stdlib-ns-files + jolt-chez fingerprint), same as clojure.edn. clojure.math: not a .clj on the seed (native math/ bindings via jolt-h79), so Chez gets its own host/chez/math.ss def-var!ing each fn over Chez native flonum math. The analyzer already knows the ns (api.janet install-clojure-math!), so refs lower to var-deref. Also adds the missing 'long' coercion to converters.ss (int's sibling; several math cases wrap in long). clojure.pprint: dropped the 2-arity's (binding [*out* writer] ...). *out* isn't a bindable var in jolt — printing routes through the host (dyn :out) seam, so the binding never redirected anything; it only made the defn uncompilable, which the seed tolerated via interpreter fallback. Chez has no fallback, so the whole pprint defn died. Dropping it is behavior-preserving (writer was always ignored) and lets pprint compile cleanly. Both corpus cases pass. Corpus parity 2259 -> 2280, crashes 191 -> 170, 0 new divergences. Floor raised. New unit test test/chez/_stdlib.janet (27/27). Full Janet gate green (147 files).
This commit is contained in:
parent
6df60229b0
commit
109bfcd09d
8 changed files with 175 additions and 7 deletions
|
|
@ -16,10 +16,15 @@
|
|||
(def ^:dynamic *print-pprint-dispatch* simple-dispatch)
|
||||
|
||||
(defn pprint
|
||||
"Print object readably followed by a newline. Writes to *out* (or the given
|
||||
writer). Not a pretty-printer on jolt — no column-aware layout."
|
||||
"Print object readably followed by a newline. Not a pretty-printer on jolt —
|
||||
no column-aware layout. jolt routes all printing through the host output seam
|
||||
(with-out-str captures it), and *out* is not a bindable var, so an explicit
|
||||
writer arg is accepted for API compatibility but not honored — output goes to
|
||||
the current output. (The old `(binding [*out* writer] ...)` never redirected
|
||||
anything either, and made the defn fall back to the interpreter; dropping it
|
||||
lets pprint compile cleanly, which the no-fallback Chez back end requires.)"
|
||||
([object] (prn object))
|
||||
([object writer] (binding [*out* writer] (prn object))))
|
||||
([object _writer] (prn object)))
|
||||
|
||||
(defmacro with-pprint-dispatch
|
||||
"Evaluate body with the given pprint dispatch selected. On jolt the dispatch is
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue