Expose raw host type-test primitives under jolt.host

The clojure.core type predicates bottom out at host tests that overlay
Clojure can't reach. Expose them under jolt.host so the predicate web can
be built as pure compositions that lower to exactly these calls:

  numeric tower: exact? flonum? integer-type? rational-type?
  collection reps: pvec? pmap? pset? cseq? empty-list? cseq-list? lazyseq?

exact? is wrapped to be total (Chez's raw exact? errors on a non-number;
the others return #f for a non-match). lazyseq? is exposed in
lazy-bridge.ss because jolt-lazyseq? is defined there, after predicates.ss.

map?/set?/seq? are deliberately not reduced to a single rep test: they are
extended at runtime with sorted-collection/record/lazy arms, so only the
rep predicates are exposed, not those unions. Additive only (new bindings,
nothing references them yet); bench unchanged within noise.
This commit is contained in:
Yogthos 2026-06-30 10:58:44 -04:00
parent 1481a806b7
commit 12058d2dcf
2 changed files with 30 additions and 0 deletions

View file

@ -93,3 +93,8 @@
(def-var! "clojure.core" "make-lazy-seq" jolt-make-lazy-seq)
(def-var! "clojure.core" "coll->cells" jolt-coll->cells)
;; jolt.host/lazyseq? — raw lazy-seq rep test (the other jolt.host type-test
;; primitives are exposed in predicates.ss; this one lives here because
;; jolt-lazyseq? is defined in this file, which loads after predicates.ss).
(def-var! "jolt.host" "lazyseq?" jolt-lazyseq?)