mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-10 08:16:15 +02:00
doc: listToAttrs: document repeated keys
This commit is contained in:
parent
16b03f03af
commit
ad46726546
1 changed files with 4 additions and 1 deletions
|
@ -2420,12 +2420,15 @@ static RegisterPrimOp primop_listToAttrs({
|
||||||
Construct a set from a list specifying the names and values of each
|
Construct a set from a list specifying the names and values of each
|
||||||
attribute. Each element of the list should be a set consisting of a
|
attribute. Each element of the list should be a set consisting of a
|
||||||
string-valued attribute `name` specifying the name of the attribute,
|
string-valued attribute `name` specifying the name of the attribute,
|
||||||
and an attribute `value` specifying its value. Example:
|
and an attribute `value` specifying its value.
|
||||||
|
In case of duplicate occurrences of the same name, the first
|
||||||
|
takes precedence. Example:
|
||||||
|
|
||||||
```nix
|
```nix
|
||||||
builtins.listToAttrs
|
builtins.listToAttrs
|
||||||
[ { name = "foo"; value = 123; }
|
[ { name = "foo"; value = 123; }
|
||||||
{ name = "bar"; value = 456; }
|
{ name = "bar"; value = 456; }
|
||||||
|
{ name = "bar"; value = 420; }
|
||||||
]
|
]
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue