From: Bart Schaefer <schaefer@brasslantern.com>
To: Zsh hackers list <zsh-workers@zsh.org>
Subject: [PATCH] Document effect of non-forking substitution on "private" parameters
Date: Sun, 28 Jan 2024 18:16:40 -0800 [thread overview]
Message-ID: <CAH+w=7Zv8AuC6uKRUD2gZ+A6zyneiGa6RmDoWrGzXDDjfcBwOQ@mail.gmail.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 29 bytes --]
Also add some index entries.
[-- Attachment #2: nofork-private.txt --]
[-- Type: text/plain, Size: 1442 bytes --]
diff --git a/Doc/Zsh/expn.yo b/Doc/Zsh/expn.yo
index e5506d469..2acfd08c9 100644
--- a/Doc/Zsh/expn.yo
+++ b/Doc/Zsh/expn.yo
@@ -1915,6 +1915,9 @@ from the final replacement in this case, and it is subject to filename
generation in the same way as `tt($LPAR())...tt(RPAR())' but is em(not)
split on tt(IFS) unless the tt(SH_WORD_SPLIT) option is set.
+cindex(substitution, command, current shell)
+cindex(substitution, command, non forking)
+cindex(substitution, nofork)
Substitutions of the form `tt(${|)var(param)tt(|)...tt(})' are similar,
except that the substitution is replaced by the value of the parameter
named by var(param). No implicit save or restore applies to var(param)
diff --git a/Doc/Zsh/mod_private.yo b/Doc/Zsh/mod_private.yo
index 184fa2be8..69a5f58be 100644
--- a/Doc/Zsh/mod_private.yo
+++ b/Doc/Zsh/mod_private.yo
@@ -84,6 +84,9 @@ created outside the local scope when it was not previously declared.)
itemiz(An exported private remains in the environment of inner scopes but
appears unset for the current shell in those scopes. Generally, exporting
private parameters should be avoided.)
+itemiz(Declaring a private parameter in a current shell command substitution
+such as `tt(${ )...tt( })' limits the parameter to the scope of the command
+substitution, just as if the parameter were declared in a function.)
enditemize()
Note that this differs from the static scope defined by compiled languages
reply other threads:[~2024-01-29 2:17 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAH+w=7Zv8AuC6uKRUD2gZ+A6zyneiGa6RmDoWrGzXDDjfcBwOQ@mail.gmail.com' \
--to=schaefer@brasslantern.com \
--cc=zsh-workers@zsh.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).