JVM parity: unchecked-char -> char, pr of infinities -> ##Inf

Allowlist review found three addressable divergences:
- unchecked-char returned a number; the JVM returns a char.
- the readable printer (pr-str, coll elements, the -e/REPL printer) rendered
  infinities as Infinity/inf; Clojure's readable form is ##Inf/##-Inf/##NaN
  (str/print still gives Infinity). So (pr-str ##Inf) => ##Inf, (str [##Inf]) =>
  [##Inf], (str ##Inf) => Infinity.

Corpus 2695->2698; allowlist 43->40 (drop the 3 now-passing entries). Re-minted.
This commit is contained in:
Yogthos 2026-06-21 17:55:05 -04:00
parent 518683ccd6
commit 4d1ec44676
5 changed files with 19 additions and 20 deletions

View file

@ -133,12 +133,12 @@
;; without a ".0" ((* 1.0 5) prints as "5", (/ 1 2) as "0.5").
(define (jolt-num->string x)
(cond
;; the -e / element printer renders the infinities and NaN as inf/-inf/nan
;; (Chez's number->string gives +inf.0 etc.); the str/print family uses the
;; long "Infinity"/"NaN" forms (see jolt-str-render-one in converters.ss).
((and (flonum? x) (fl= x +inf.0)) "inf")
((and (flonum? x) (fl= x -inf.0)) "-inf")
((and (flonum? x) (not (fl= x x))) "nan")
;; the -e / element printer renders the infinities and NaN in READABLE form
;; (##Inf reads back, like Clojure's REPL/pr); str/print uses "Infinity"/"NaN"
;; (see jolt-str-render-one in converters.ss).
((and (flonum? x) (fl= x +inf.0)) "##Inf")
((and (flonum? x) (fl= x -inf.0)) "##-Inf")
((and (flonum? x) (not (fl= x x))) "##NaN")
((and (rational? x) (integer? x)) (number->string (exact x)))
(else (number->string x))))