From e807ac1157015581c1466407cbe722179244be37 Mon Sep 17 00:00:00 2001 From: Bart Schaefer Date: Sun, 12 Feb 2023 11:32:11 -0800 Subject: 51375: Clarify documentation, fix typos, add indexing. --- Doc/Zsh/builtins.yo | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'Doc/Zsh/builtins.yo') diff --git a/Doc/Zsh/builtins.yo b/Doc/Zsh/builtins.yo index 64c47346f..97a82226b 100644 --- a/Doc/Zsh/builtins.yo +++ b/Doc/Zsh/builtins.yo @@ -2041,16 +2041,22 @@ 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. No other attribute flags may be used in conjunction with -tt(-n). The var(name) assigned-to may not be an array element nor use +created. No attributes except tt(-g) 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 (incuding an associative +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. See ifzman(zmanref(zshexpn))ifnzman(noderef(Parameter Expansion)) and ifzman(zmanref(zshparam))ifnzman(noderef(Parameters)) for details of the behavior of named references. +Local function scoping rules for `tt(typeset)' do apply with `tt(-n)', +so a declaration within a function persists only until the end of the +function unless `tt(-g -n)' is specified, and any local parameter (of +any type) with the same var(name) supplants a named reference from a +surrounding scope. + If no attribute flags are given, and either no var(name) arguments are present or the flag tt(+m) is used, then each parameter name printed is preceded by a list of the attributes of that parameter (tt(array), -- cgit 1.4.1