-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Closed
Labels
docsImprovements or additions to documentationImprovements or additions to documentation
Description
Description
I want to explicitly document how are dictionaries added.
Specifically, values in the second dictionary will override values in the first one, but the order of keys is kept.
For example, (a: 1, b: 2) + (a: 3) is (a: 3, b: 2), not (a: 1, b: 2) or (b: 2, a: 3).
See IndexMap::extend in indexmap::map - Rust.
Besides, maybe add a link from dictionary.insert.
Dictionaries guarantee insertion order
At present, it looks like the following sentence is the only documentation. And there's no test for + and join.
typst/crates/typst-library/src/foundations/dict.rs
Lines 44 to 45 in 130d0ab
| /// access the value. Dictionaries can be added with the `+` operator and | |
| /// [joined together]($scripting/#blocks). To check whether a key is present in |
A bit relates to #1258.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
docsImprovements or additions to documentationImprovements or additions to documentation