fix: case composite constants, associative?/reversible?, update non-fn args, nth nil

- case: quote list literals (read as arrays) in constant position so a wrapped
  list ((a b c)) matches by value instead of being evaluated as a call; symbol
  constants already quoted. Vector/map/set constants already worked. case errors
  in the suite drop to 0 (60 pass).
- associative?: true only for vectors (pvec) and maps (phm/struct/sorted-map),
  not lists/tuples-from-seq-fns/lazy-seqs/sets.
- reversible?: true for vectors and sorted-map/sorted-set only.
- update: coerce f via as-fn so (update m k :kw)/(update m k a-set) work; extra
  args already handled.
- nth: (nth nil i)/(nth nil i default) returns nil/default instead of throwing.

clojure-test-suite pass 3649->3678, errors 122->105, clean files 44->46.
associative?/reversible? files now fully clean. spec: predicates + control/case.
jpm test green.
This commit is contained in:
Yogthos 2026-06-05 10:19:43 -04:00
parent 2ccfa675f7
commit bcdace7543
4 changed files with 28 additions and 7 deletions

View file

@ -34,6 +34,12 @@
["sequential? vector" "true" "(sequential? [1])"]
["associative? map" "true" "(associative? {:a 1})"]
["associative? vec" "true" "(associative? [1])"]
["associative? list" "false" "(associative? '(1 2))"]
["associative? set" "false" "(associative? #{1})"]
["reversible? vec" "true" "(reversible? [1 2])"]
["reversible? list" "false" "(reversible? '(1 2))"]
["reversible? smap" "true" "(reversible? (sorted-map :a 1))"]
["reversible? hmap" "false" "(reversible? (hash-map :a 1))"]
["indexed? vector" "true" "(indexed? [1])"]
["counted? vector" "true" "(counted? [1])"])