1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-07-16 02:01:59 +02:00

Document null dynamic attrs

This commit is contained in:
Shea Levy 2014-03-10 07:09:07 -04:00 committed by Eelco Dolstra
parent 049a379ec6
commit 2f2a20ed18
2 changed files with 15 additions and 1 deletions

View file

@ -871,6 +871,17 @@ This will evaluate to <literal>123</literal> if
coerced to a string and <literal>456</literal> otherwise (again
assuming <literal>bar</literal> is antiquotable).</para>
<para>In the special case where an attribute name inside of a set declaration
evaluates to <literal>"${null}"</literal> (which is normally an error, as
<literal>null</literal> is not antiquotable), that attribute is simply not
added to the set:
<programlisting>
{ ${if foo then "bar" else null} = true; }</programlisting>
This will evaluate to <literal>{}</literal> if <literal>foo</literal>
evaluates to <literal>false</literal>.</para>
</simplesect>