defn docstrings, assert throws AssertionError, Seqable covers collections
Conformance gaps surfaced re-running the library suites: - defn now keeps a leading docstring as :doc metadata — it was dropped, so (:doc (meta #'f)) was always nil. Rides the def docstring slot. - assert (and :pre/:post) throw a real AssertionError instead of an ex-info, so (catch AssertionError …) / (thrown? AssertionError …) match, with Clojure's "Assert failed: <msg>\n<form>" message. - instance? clojure.lang.Seqable was conflated with ISeq, so a vector/map read as not-Seqable. Split them: Seqable covers every persistent collection, ISeq only seqs.
This commit is contained in:
parent
60e129a95c
commit
14ce46fb2a
6 changed files with 926 additions and 909 deletions
|
|
@ -669,8 +669,14 @@
|
|||
((string=? iface "IPersistentMap") (or (pmap? val) (htable-sorted-map? val)))
|
||||
((string=? iface "IPersistentVector") (and (pvec? val) (not (jolt-map-entry? val))))
|
||||
((string=? iface "IPersistentSet") (or (pset? val) (htable-sorted-set? val)))
|
||||
((or (string=? iface "ISeq") (string=? iface "Seqable"))
|
||||
((string=? iface "ISeq")
|
||||
(or (cseq? val) (empty-list-t? val) (jolt-lazyseq? val)))
|
||||
;; Seqable is anything (seq x) works on — every persistent
|
||||
;; collection, not just seqs (a vector IS Seqable, not an ISeq).
|
||||
((string=? iface "Seqable")
|
||||
(or (cseq? val) (empty-list-t? val) (jolt-lazyseq? val)
|
||||
(pvec? val) (pmap? val) (pset? val)
|
||||
(htable-sorted-map? val) (htable-sorted-set? val)))
|
||||
((string=? iface "Sequential")
|
||||
(or (pvec? val) (cseq? val) (empty-list-t? val) (jolt-lazyseq? val)))
|
||||
((string=? iface "IFn")
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Loading…
Add table
Add a link
Reference in a new issue