Migrate list?/ratio?/rational? to the overlay; narrow jolt.host exposure
list?, ratio?, and rational? are the predicate-web members that are genuinely safe to migrate: not extended at runtime, not on the compiler emit/inference path, not reached by the kernel tier. They now live in the overlay (clojure/core/20-coll.clj) built on the jolt.host tower/rep tests, lowering to the same code the native shims did. Removed their native definitions (predicates.ss) and, for ratio?/rational?, the now-redundant post-prelude re-assertions. Also dropped the dead all-flonum overlay ratio?/rational?/decimal? stubs. The rest of the web stays native and is documented as such: map?/set?/ seq?/coll? are extended with sorted/record/lazy arms, decimal? is extended by the optional bigdec module, integer?/float? are on the emit/inference path, vector? is reached by the kernel-tier peek. jolt.host exposure is therefore narrowed to just the tests these three consume (exact?, rational-type?, cseq?, cseq-list?, empty-list?). Numeric probe is byte-identical to pre-migration; list? correct across list/vector/lazy/empty/cons/rest cases. Selfhost fixpoint holds, values/ unit/smoke/corpus green, bench flat within noise.
This commit is contained in:
parent
12058d2dcf
commit
bbca8bc0de
5 changed files with 43 additions and 47 deletions
|
|
@ -78,18 +78,19 @@
|
|||
(def-var! "clojure.core" "line-seq"
|
||||
(lambda (rdr)
|
||||
(if (reader-jhost? rdr) (chez-line-seq rdr) (jolt-invoke overlay-line-seq rdr)))))
|
||||
;; JVM-parity numeric tower: the overlay (20-coll.clj) carries an
|
||||
;; all-flonum number-predicate web with no Ratio concept (ratio? -> false,
|
||||
;; double? -> not-integer, float? -> double?, rational? -> int?), which
|
||||
;; misclassifies exact rationals on the Chez tower (e.g. (double? 1/2) -> true).
|
||||
;; Re-assert the native tower-correct versions (predicates.ss) so they win over
|
||||
;; the overlay defs. int?/double? alias integer?/float?. == is value-equality.
|
||||
;; JVM-parity numeric tower. integer?/float? are on the compiler emit/inference
|
||||
;; path (so they stay native) but the overlay (20-coll.clj) still carries an
|
||||
;; all-flonum int?/double? (int? -> integer?, double? -> not-integer) that
|
||||
;; misclassifies exact rationals (e.g. (double? 1/2) -> true). Re-assert the
|
||||
;; native tower-correct versions so they win over those overlay defs. int?/double?
|
||||
;; alias integer?/float?. == is value-equality. (ratio?/rational? are now correct
|
||||
;; in the overlay, built on jolt.host tower tests, so they need no re-assertion.)
|
||||
(def-var! "clojure.core" "integer?" jolt-integer?)
|
||||
(def-var! "clojure.core" "int?" jolt-integer?)
|
||||
(def-var! "clojure.core" "float?" jolt-float?)
|
||||
(def-var! "clojure.core" "double?" jolt-float?)
|
||||
(def-var! "clojure.core" "ratio?" jolt-ratio?)
|
||||
(def-var! "clojure.core" "rational?" jolt-rational?)
|
||||
;; ratio?/rational? now live (correctly) in the overlay, so they no longer need a
|
||||
;; native re-assertion here. decimal? stays (bigdec re-binds it).
|
||||
(def-var! "clojure.core" "decimal?" jolt-decimal?)
|
||||
(def-var! "clojure.core" "==" jolt-num-equiv)
|
||||
;; chunked-seq? is true for a vector's seq (a real chunked-seq); the overlay's
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue