Chez inc 3m: numeric-edge literal emit + variadic assoc!
##Inf/##-Inf/##NaN were emitted to bare inf/-inf/nan, which are unbound symbols in
Chez. emit-const now lowers them to +inf.0/-inf.0/+nan.0. The -e/element printer
renders them inf/-inf/nan (Chez's number->string gives +inf.0), and str renders the
long Clojure forms Infinity/-Infinity/NaN. assoc! is now variadic ((assoc! t k v
& kvs)) like Clojure.
Prelude parity 1382 -> 1407/2497, 0 new divergences. str of inf INSIDE a collection
still wants the long form (needs the Phase-2 recursive str renderer), so
[inf inside coll] is allowlisted. Transducer arities and the cdr-on-()/\p{} regex
gaps are split out to jolt-kxsr/jolt-y1zq.
This commit is contained in:
parent
1826c8b3e9
commit
c28b5406ca
7 changed files with 65 additions and 16 deletions
|
|
@ -13,6 +13,11 @@
|
|||
((string? v) v)
|
||||
((char? v) (string v))
|
||||
((regex-t? v) (regex-t-source v))
|
||||
;; str/print render the infinities and NaN long-form (Clojure .toString),
|
||||
;; unlike the -e printer's inf/-inf/nan.
|
||||
((and (flonum? v) (fl= v +inf.0)) "Infinity")
|
||||
((and (flonum? v) (fl= v -inf.0)) "-Infinity")
|
||||
((and (flonum? v) (not (fl= v v))) "NaN")
|
||||
(else (jolt-pr-str v))))
|
||||
(define (jolt-str . xs)
|
||||
(let loop ((xs xs) (acc '()))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue