Nix Language Quirks: Difference between revisions

H7x4 (talk | contribs)
Add entry about using null as attrset key
m Grammar
Line 38: Line 38:
Destructured arguments can have default values, but those default values are part of the full function argument.
Destructured arguments can have default values, but those default values are part of the full function argument.


In the following example, calling the function that binds a default value <code>"a"</code> to the argument's attribute <code>a</code> with an empty attribute set as argument will produce an empty attribute set <code>args</code> instead of <code>{ a = "a"; }</code>:
In the following example, calling the function that binds a default value <code>"a"</code> to the argument's attribute <code>a</code> with an empty attribute set as an argument will produce an empty attribute set <code>args</code> instead of <code>{ a = "a"; }</code>:


<syntaxHighlight lang=nix>
<syntaxHighlight lang=nix>