forked from lix-project/lix
Document null dynamic attrs
This commit is contained in:
parent
049a379ec6
commit
2f2a20ed18
|
@ -25,7 +25,10 @@
|
||||||
attribute names (e.g. <literal>set."${foo}"</literal>). In the
|
attribute names (e.g. <literal>set."${foo}"</literal>). In the
|
||||||
case where the attribute name is just a single antiquotation,
|
case where the attribute name is just a single antiquotation,
|
||||||
the quotes can be dropped (e.g. the above example can be written
|
the quotes can be dropped (e.g. the above example can be written
|
||||||
<literal>set.${foo}</literal>).</para></listitem>
|
<literal>set.${foo}</literal>). If an attribute name inside of a
|
||||||
|
set declaration evaluates to <literal>"${null}"</literal> (e.g.
|
||||||
|
<literal>{ ${null} = false; }</literal>), then that attribute is not added
|
||||||
|
added to the set.</para></listitem>
|
||||||
|
|
||||||
</itemizedlist>
|
</itemizedlist>
|
||||||
|
|
||||||
|
|
|
@ -871,6 +871,17 @@ This will evaluate to <literal>123</literal> if
|
||||||
coerced to a string and <literal>456</literal> otherwise (again
|
coerced to a string and <literal>456</literal> otherwise (again
|
||||||
assuming <literal>bar</literal> is antiquotable).</para>
|
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>
|
</simplesect>
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue