about summary refs log tree commit diff
path: root/doc
diff options
context:
space:
mode:
authorShea Levy <shea@shealevy.com>2014-03-10T11·09-0400
committerEelco Dolstra <eelco.dolstra@logicblox.com>2014-03-11T12·15+0100
commit2f2a20ed18535ba819225fabe9a4cf2f37d2edb1 (patch)
treed5378f4677c7828ed48fa7c843701c4015637fce /doc
parent049a379ec6ca755bcc077fd0e8da186ff76b8679 (diff)
Document null dynamic attrs
Diffstat (limited to 'doc')
-rw-r--r--doc/manual/release-notes.xml5
-rw-r--r--doc/manual/writing-nix-expressions.xml11
2 files changed, 15 insertions, 1 deletions
diff --git a/doc/manual/release-notes.xml b/doc/manual/release-notes.xml
index 56f7bd65490d..44762d1d6c8a 100644
--- a/doc/manual/release-notes.xml
+++ b/doc/manual/release-notes.xml
@@ -25,7 +25,10 @@
   attribute names (e.g. <literal>set."${foo}"</literal>). In the
   case where the attribute name is just a single antiquotation,
   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>
 
diff --git a/doc/manual/writing-nix-expressions.xml b/doc/manual/writing-nix-expressions.xml
index 71cd84b072b4..873dc21a5292 100644
--- a/doc/manual/writing-nix-expressions.xml
+++ b/doc/manual/writing-nix-expressions.xml
@@ -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>