about summary refs log tree commit diff
path: root/Doc/Zsh/builtins.yo
diff options
context:
space:
mode:
authorBart Schaefer <schaefer@zsh.org>2024-03-04 21:07:01 -0800
committerBart Schaefer <schaefer@zsh.org>2024-03-04 21:07:01 -0800
commit610b18875ad9f4498a57e9af6903bcac3b14ff46 (patch)
tree44123f9fbd7650323f320cb81b4ed05448dd36d1 /Doc/Zsh/builtins.yo
parent05c7b21e2b30873d002b50b37e2fbd3803d4b608 (diff)
downloadzsh-610b18875ad9f4498a57e9af6903bcac3b14ff46.tar.gz
zsh-610b18875ad9f4498a57e9af6903bcac3b14ff46.tar.xz
zsh-610b18875ad9f4498a57e9af6903bcac3b14ff46.zip
52650 plus minor fixes: add -u for named references pointing to "upper" scope
Diffstat (limited to 'Doc/Zsh/builtins.yo')
-rw-r--r--Doc/Zsh/builtins.yo8
1 files changed, 6 insertions, 2 deletions
diff --git a/Doc/Zsh/builtins.yo b/Doc/Zsh/builtins.yo
index 6318053d8..7a9684ac8 100644
--- a/Doc/Zsh/builtins.yo
+++ b/Doc/Zsh/builtins.yo
@@ -2052,13 +2052,17 @@ cindex(named reference)
 cindex(reference, named)
 The flag tt(-n) creates a em(named reference) to another parameter.
 The second parameter need not exist at the time the reference is
-created.  Only tt(-g) and tt(-r) may be used in conjunction with
+created.  Only tt(-g), tt(-u), and tt(-r) may be used in conjunction with
 tt(-n).  The var(name) so created may not be an array element nor use
 a subscript, but the var(value) assigned may be any valid parameter
 name syntax, even a subscripted array element (including an associative
 array element) or an array slice, which is evaluated when the named
 reference is expanded.  It is an error for a named reference to refer
-to itself, even indirectly through a chain of references.
+to itself, even indirectly through a chain of references.  When tt(-u)
+is applied to a named reference, the parameter identified by var(value)
+is always found in the calling function scope rather than the current
+local scope.  In this case, if there is no such parameter in the calling
+scope, assignments to the named reference may fail, setting tt($?) to 1.
 See ifzman(zmanref(zshexpn))ifnzman(noderef(Parameter Expansion)) and
 ifzman(zmanref(zshparam))ifnzman(noderef(Parameters)) for details of the
 behavior of named references.