diff options
author | Orivej Desh <orivej@gmx.fr> | 2017-10-26 18:50:30 +0000 |
---|---|---|
committer | Orivej Desh <orivej@gmx.fr> | 2017-10-26 18:53:36 +0000 |
commit | 15457c56731537e0d424d5feb3f3fcacba39b99b (patch) | |
tree | da4edca8ca35cc8f85cc96e28a6ae0a156d06f93 /doc | |
parent | e5c499b833a329876649f7efc1cbdc7b9a64092c (diff) |
Describe "with" scoping precedence
Diffstat (limited to 'doc')
-rw-r--r-- | doc/manual/expressions/language-constructs.xml | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/doc/manual/expressions/language-constructs.xml b/doc/manual/expressions/language-constructs.xml index fe69dba83..2f0027d47 100644 --- a/doc/manual/expressions/language-constructs.xml +++ b/doc/manual/expressions/language-constructs.xml @@ -333,7 +333,20 @@ with (import ./definitions.nix); ...</programlisting> makes all attributes defined in the file <filename>definitions.nix</filename> available as if they were defined -locally in a <literal>rec</literal>-expression.</para> +locally in a <literal>let</literal>-expression.</para> + +<para>The bindings introduced by <literal>with</literal> do not shadow bindings +introduced by other means, e.g. + +<programlisting> +let a = 3; in with { a = 1; }; let a = 4; in with { a = 2; }; ...</programlisting> + +establishes the same scope as + +<programlisting> +let a = 1; in let a = 2; in let a = 3; in let a = 4; in ...</programlisting> + +</para> </simplesect> |