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
|
|
@ -52,7 +52,7 @@
|
|||
((empty-list-t? x) jolt-nil)
|
||||
((cseq? x) x)
|
||||
((pvec? x) (vec->seq x 0))
|
||||
((pmap? x) (list->cseq (pmap-fold x (lambda (k v a) (cons (jolt-vector k v) a)) '())))
|
||||
((pmap? x) (list->cseq (pmap-fold x (lambda (k v a) (cons (make-map-entry k v) a)) '())))
|
||||
((pset? x) (list->cseq (pset-fold x cons '())))
|
||||
((string? x) (str->seq x 0))
|
||||
(else (error 'seq "not seqable" x))))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue