Collection ops carry the receiver's metadata
conj/assoc/dissoc/disj/pop/into and empty now thread the receiver's metadata onto the result, matching Clojure (each op constructs a new collection with meta() carried forward; coll.empty() is EMPTY.withMeta(meta())). The metadata side-table is now weak so meta on intermediate collections is reclaimed with them, and empty-list-t carries an (unused) field so a metadata-bearing () is a distinct identity from the shared singleton instead of leaking meta onto every (). Unblocks metadata-driven walks (aero/integrant): (into (empty form) ...) now preserves a vector/map/set's metadata, so a postwalk whose outer fn reads (meta x) sees it.
This commit is contained in:
parent
5b55c7f7b0
commit
4ae3d3116e
7 changed files with 484 additions and 457 deletions
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