diff options
author | Peter Stephenson <pws@users.sourceforge.net> | 2011-08-03 18:45:17 +0000 |
---|---|---|
committer | Peter Stephenson <pws@users.sourceforge.net> | 2011-08-03 18:45:17 +0000 |
commit | d48faef8cdff3c7c63c0a9164443e3d337aa1ec1 (patch) | |
tree | e9096e7fc93bbfdcc8fbc751c6117976ad2c0189 /Doc | |
parent | 771b059a526effbddb895fb041e30b3a5e038b48 (diff) | |
download | zsh-d48faef8cdff3c7c63c0a9164443e3d337aa1ec1.tar.gz zsh-d48faef8cdff3c7c63c0a9164443e3d337aa1ec1.tar.xz zsh-d48faef8cdff3c7c63c0a9164443e3d337aa1ec1.zip |
29633: more care with anonymous and other functions
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/Zsh/func.yo | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/Doc/Zsh/func.yo b/Doc/Zsh/func.yo index 89b956cb4..7c391f80d 100644 --- a/Doc/Zsh/func.yo +++ b/Doc/Zsh/func.yo @@ -162,8 +162,15 @@ is not stored for future use. The function name is set to `tt((anon))'. Arguments to the function may be specified as words following the closing brace defining the function, hence if there are none no -arguments (other than tt($0)) are set. Note that this means -the argument list of any enclosing script or function is hidden. +arguments (other than tt($0)) are set. This is a difference from the +way other functions are parsed: normal function definitions may be +followed by certain keywords such as `tt(else)' or `tt(fi)', which will +be treated as arguments to anonymous functions, so that a newline or +semicolon is needed to force keyword interpretation. + +Note also that the argument list of any enclosing script or function is +hidden (as would be the case for any other function called at this +point). Redirections may be applied to the anonymous function in the same manner as to a current-shell structure enclosed in braces. The main use of anonymous |