diff options
| author | Bart Schaefer <schaefer@zsh.org> | 2025-05-12 21:29:16 -0700 |
|---|---|---|
| committer | Bart Schaefer <schaefer@zsh.org> | 2025-05-12 21:29:16 -0700 |
| commit | b0fa403a3da0f01cb75eeea701c652b007b5db1b (patch) | |
| tree | 76e399f6bb21f0570945ae44f651b978033bd7ad /Doc/Zsh/func.yo | |
| parent | unposted: fix bad pointer found by valgrind (diff) | |
| download | zsh-b0fa403a3da0f01cb75eeea701c652b007b5db1b.tar zsh-b0fa403a3da0f01cb75eeea701c652b007b5db1b.tar.gz zsh-b0fa403a3da0f01cb75eeea701c652b007b5db1b.tar.bz2 zsh-b0fa403a3da0f01cb75eeea701c652b007b5db1b.tar.lz zsh-b0fa403a3da0f01cb75eeea701c652b007b5db1b.tar.xz zsh-b0fa403a3da0f01cb75eeea701c652b007b5db1b.tar.zst zsh-b0fa403a3da0f01cb75eeea701c652b007b5db1b.zip | |
53602: "typeset -nu" always refers to at a call level above the declaration
Diffstat (limited to 'Doc/Zsh/func.yo')
| -rw-r--r-- | Doc/Zsh/func.yo | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/Doc/Zsh/func.yo b/Doc/Zsh/func.yo index 7b71e34e9..9558b11c4 100644 --- a/Doc/Zsh/func.yo +++ b/Doc/Zsh/func.yo @@ -23,9 +23,11 @@ declared in an earlier function scope. (See noderef(Local Parameters).) A named parameter declared with the `tt(-n)' option to any of the -`tt(typeset)' commands becomes a reference to a parameter in scope at -the time of assignment to the named reference, which may be at a -different call level than the declaring function. For this reason, +`tt(typeset)' acts as a reference to another parameter, which may +be at a different call level than the declaring function. When the +`tt(-u)' option is also given, the referenced parameter is always +found at a call level above the function where the reference is +declared, otherwise the reference scope is dynamic. For this reason, it is good practice to declare a named reference as soon as the referent parameter is in scope, and as early as possible in the function if the reference is to a parameter in a calling scope. |
