diff options
author | Eelco Dolstra <edolstra@gmail.com> | 2019-05-22T12·14+0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-05-22T12·14+0200 |
commit | bfc6bdf222d00d3cb1b0e168a5d55d1a7c9cdb72 (patch) | |
tree | 1e029b0bb9267309e50ee5bcd329235b1154babd | |
parent | 4d829916e7c81529257e25dd4fca1cc27096ba8d (diff) | |
parent | b502b6682b9c73ae5760967eaf7161b3e8523e9e (diff) |
Merge pull request #2880 from Ma27/document-optional-attrs-with-at-pattern
doc: clarify that optional attrs in a function argument will be ignored unless specified
-rw-r--r-- | doc/manual/expressions/language-constructs.xml | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/doc/manual/expressions/language-constructs.xml b/doc/manual/expressions/language-constructs.xml index f961ed921bca..923b5d8c4011 100644 --- a/doc/manual/expressions/language-constructs.xml +++ b/doc/manual/expressions/language-constructs.xml @@ -217,7 +217,25 @@ but can also be written as: ellipsis(<literal>...</literal>) as you can access attribute names as <literal>a</literal>, using <literal>args.a</literal>, which was given as an additional attribute to the function. - </para></listitem> + </para> + + <warning> + <para> + The <literal>args@</literal> expression is bound to the argument passed to the function which + means that attributes with defaults that aren't explicitly specified in the function call + won't cause an evaluation error, but won't exist in <literal>args</literal>. + </para> + <para> + For instance +<programlisting> +let + function = args@{ a ? 23, ... }: args; +in + function {} +</programlisting> + will evaluate to an empty attribute set. + </para> + </warning></listitem> </itemizedlist> |