Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
PATCH: Clarify namespaces starting with a .
- X-seq: zsh-workers 53660
- From: Mikael Magnusson <mikachu@xxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: PATCH: Clarify namespaces starting with a .
- Date: Thu, 22 May 2025 03:39:02 +0200
- Archived-at: <https://zsh.org/workers/53660>
- List-id: <zsh-workers.zsh.org>
The way this was written to me implied that the . was so optional that it referred to the same parameter, but this is not the case, so clarify this. Also remove duplicated text, the expansion documentation shouldn't say the . is optional anyway, since it isn't when expanding a specific parameter that either does or doesn't start with a ..
It seems that leading dots are now also allowed for non-namespace parameters, eg .foo=bar but I'm not sure if this is already mentioned somewhere?
---
Doc/Zsh/expn.yo | 4 +---
Doc/Zsh/params.yo | 7 +++++--
2 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/Doc/Zsh/expn.yo b/Doc/Zsh/expn.yo
index 1db65d24f1..70212dbc8f 100644
--- a/Doc/Zsh/expn.yo
+++ b/Doc/Zsh/expn.yo
@@ -616,9 +616,7 @@ the format `tt(.)var(identifier)tt(.)' This currently has no special
meaning to the shell, but provides a convenient means of grouping
related parameters. Expansions using a namespace em(must) include
braces (tt({) and tt(})) as shown in the descriptions below, and
-only one namespace prefix is allowed. Note that, for support of
-possible future features, the first `tt(.)' is optional, but omitting
-it is discouraged.
+only one namespace prefix is allowed.
In the expansions discussed below that require a pattern, the form of
the pattern is the same as that used for filename generation;
diff --git a/Doc/Zsh/params.yo b/Doc/Zsh/params.yo
index 59e964519f..0a550cf965 100644
--- a/Doc/Zsh/params.yo
+++ b/Doc/Zsh/params.yo
@@ -67,8 +67,11 @@ with a `tt(.)' prefix are not listed by the `tt(set)' builtin, nor
shown by the `tt(typeset)' builtin unless explicitly named or the
`tt(-m)' option is used. They provide a convenient way to group
related variables. Note that, for support of possible future features,
-the first `tt(.)' is optional, but omitting it is discouraged. Unlike
-ksh, a namespace need not be declared before it is referenced.
+the first `tt(.)' is optional, but omitting it is discouraged. Note also
+that a name starting with a `tt(.)' does not refer to the same parameter
+as one that does not, eg, `tt(.foo.bar)' and `tt(foo.bar)' are distinct
+parameters. Unlike ksh, a namespace need not be declared before it
+is referenced.
In scalar assignment, var(value) is expanded as a single string, in
which the elements of arrays are joined together; filename expansion is
--
2.38.1
Messages sorted by:
Reverse Date,
Date,
Thread,
Author