Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: PATCH: Clarify namespaces starting with a .
- X-seq: zsh-workers 53662
- From: dana <dana@xxxxxxx>
- To: "Mikael Magnusson" <mikachu@xxxxxxxxx>
- Cc: zsh-workers@xxxxxxx
- Subject: Re: PATCH: Clarify namespaces starting with a .
- Date: Wed, 21 May 2025 21:11:05 -0500
- Archived-at: <https://zsh.org/workers/53662>
- Feedback-id: i9be146f9:Fastmail
- In-reply-to: <20250522013902.14555-1-mikachu@gmail.com>
- List-id: <zsh-workers.zsh.org>
- References: <20250522013902.14555-1-mikachu@gmail.com>
On Wed 21 May 2025, at 20:39, Mikael Magnusson wrote:
> 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
some tests related to this and other things discussed on irc
dana
diff --git a/Test/K02parameter.ztst b/Test/K02parameter.ztst
index 0b1a8dd4a..f9f434b36 100644
--- a/Test/K02parameter.ztst
+++ b/Test/K02parameter.ztst
@@ -106,11 +106,21 @@ F:Braces are required
0:Parse without leading dot (future proofing)
>empty test
+ .k02.a=b
+ k02.a=c
+ print ${.k02.a} ${k02.a}
+0:With and without leading dot are distinct
+>b c
+
.k=OK
print ${.k}
0:Bare namespace is usable (ksh compatibility)
>OK
+ ..k=OK
+127:Bare namespace is not usable with two dots
+?(eval):1: command not found: ..k=OK
+
.k.=empty
1:Namespace must precede an identifier, assignment
?(eval):1: not an identifier: .k.
@@ -147,6 +157,12 @@ F:Braces are required
1:Identifier starting with a digit must be all digits, reference
?(eval):1: bad substitution
+ .n.s.k=OK
+ print ${.n.s.k}
+127:Nested namespace is not usable
+?(eval):1: command not found: .n.s.k=OK
+?(eval):2: bad substitution
+
integer .var.d=0
float .var.f=.2
print $((.var.x = ++.var.d - -.var.f))
Messages sorted by:
Reverse Date,
Date,
Thread,
Author