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:
parent
711a938943
commit
d189ee2ded
2 changed files with 4 additions and 1 deletions
|
|
@ -43,6 +43,8 @@
|
|||
["map" "[2 3 4]" "(map inc [1 2 3])"]
|
||||
["map two colls" "[5 7 9]" "(map + [1 2 3] [4 5 6])"]
|
||||
["map stops at shortest" "[5 7]" "(map + [1 2] [4 5 6])"]
|
||||
# nil elements are values, not end-of-seq: multi-coll map must not truncate.
|
||||
["map keeps nil elements" "[[1 :a] [nil :b] [3 nil]]" "(map vector [1 nil 3] [:a :b nil])"]
|
||||
["map-indexed" "[[0 :a] [1 :b]]" "(map-indexed vector [:a :b])"]
|
||||
["mapv" "[2 3 4]" "(mapv inc [1 2 3])"]
|
||||
["filter" "[2 4]" "(filter even? [1 2 3 4])"]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue