Chez Phase 2 (inc A): collection ctors + real map entries
set/hash-map/hash-set/array-map/rand resolved to jolt-nil on the prelude (the apply-jolt-nil crash bucket) — the pmap/pset ctors already existed in collections.ss, just bind the public clojure.core names to them. Map entries are now a distinct type: a pvec carries an ent flag (default #f), so an entry equals its [k v] vector and walks like one (nth/count/seq/=/hash/ print read only v) but is not vector? and is map-entry? — matching Clojure's MapEntry. seqing a map produces flagged entries; vector? excludes them. This unblocks key/val (overlay fns gated on map-entry?) and the every? map-entry? cases. Prelude parity 1534 -> 1593, 0 new divergences. jolt-agw6.
This commit is contained in:
parent
e98afcad13
commit
9b0d6acadc
6 changed files with 56 additions and 4 deletions
|
|
@ -8,7 +8,9 @@
|
|||
;; seed predicates are simply absent here for now.
|
||||
|
||||
(define (jolt-map? x) (pmap? x))
|
||||
(define (jolt-vector? x) (pvec? x))
|
||||
;; a map entry is a pvec under the hood but is NOT vector? (matches Clojure's
|
||||
;; MapEntry — jolt-agw6); the public vector? predicate excludes it.
|
||||
(define (jolt-vector? x) (and (pvec? x) (not (pvec-ent x))))
|
||||
(define (jolt-set? x) (pset? x))
|
||||
(define (jolt-seq? x) (or (cseq? x) (empty-list-t? x)))
|
||||
(define (jolt-coll-pred? x)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue