Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: namespaces limitation
- X-seq: zsh-workers 51782
- From: Oliver Kiddle <opk@xxxxxxx>
- To: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- Cc: Zsh workers <zsh-workers@xxxxxxx>
- Subject: Re: namespaces limitation
- Date: Wed, 24 May 2023 18:41:10 +0200
- Archived-at: <https://zsh.org/workers/51782>
- In-reply-to: <CAH+w=7ZZRQiboQYwgnZwpkger+i2pnyP3Y55gC4vnwkVnfUJCg@mail.gmail.com>
- List-id: <zsh-workers.zsh.org>
- References: <9849-1684455235.063540@_q24.9gsR.Efjj> <CAH+w=7ZZRQiboQYwgnZwpkger+i2pnyP3Y55gC4vnwkVnfUJCg@mail.gmail.com>
Bart Schaefer wrote:
> Yes, the first character of a namespace identifier should probably be
> an alphabetic. Or an underscore? That might really complicate math
> lexing, given that we allow underscores in numeric constants.
What's allowed in math context can be (and already is) more restrictive
that what it's possible to declare.
One option might be to disallow bare namespaces, so
integer .var=56
would be disallowed. Where .3 just looks really wrong, .3.var feels
innocuous.
In ksh93:
$ .var=23
$ typeset -p .var
.var=23
$ namespace var { val=78; }
$ typeset -p .var
namespace var
{
val=78
}
Also questionable is the following which currently works:
.a.=ddd
The ksh error for this is 'no parent' even if you create an "a"
namespace first. We also currently allow a.=ddd but I think that is less
questionable. We allow empty association elements.
Oliver
Messages sorted by:
Reverse Date,
Date,
Thread,
Author