spec: regression cases for with-meta nil and multi-coll map nil elements

Document the two fixed behaviors in the contract spec: (with-meta x nil) clears
metadata, and a multi-collection map keeps nil elements (they're values, not
end-of-seq). The reader grammar (doc/grammar.ebnf) is unchanged — this session
touched semantics/stdlib, not surface syntax.
This commit is contained in:
Yogthos 2026-06-06 19:52:54 -04:00
parent 711a938943
commit d189ee2ded
2 changed files with 4 additions and 1 deletions

View file

@ -8,7 +8,8 @@
["with-meta on map" "{:doc \"x\"}" "(meta (with-meta {:k 1} {:doc \"x\"}))"]
["vary-meta" "{:a 2}" "(meta (vary-meta (with-meta [1] {:a 1}) update :a inc))"]
["meta reader ^" "{:tag :int}" "(meta ^{:tag :int} [1 2])"]
["with-meta on fn ok" "true" "(fn? (with-meta inc {:a 1}))"])
["with-meta on fn ok" "true" "(fn? (with-meta inc {:a 1}))"]
["with-meta nil clears" "nil" "(meta (with-meta [1 2 3] nil))"])
(defspec "metadata / type hints"
# ^Type / ^:kw / ^"str" on a symbol attach as metadata and are otherwise inert: