Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: PATCH: Clarify namespaces starting with a .



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