zsh-workers
 help / color / mirror / code / Atom feed
From: Oliver Kiddle <opk@zsh.org>
To: Bart Schaefer <schaefer@brasslantern.com>
Cc: Zsh workers <zsh-workers@zsh.org>
Subject: Re: namespaces limitation
Date: Wed, 24 May 2023 18:41:10 +0200	[thread overview]
Message-ID: <92928-1684946470.047218@Qy70.4SHd.nnDI> (raw)
In-Reply-To: <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


  reply	other threads:[~2023-05-24 16:41 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-19  0:13 Oliver Kiddle
2023-05-23 17:10 ` Bart Schaefer
2023-05-24 16:41   ` Oliver Kiddle [this message]
2023-05-25 22:09     ` Bart Schaefer
2023-05-25 23:13       ` Bart Schaefer
2023-06-22 17:49       ` [PATCH] " Bart Schaefer

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=92928-1684946470.047218@Qy70.4SHd.nnDI \
    --to=opk@zsh.org \
    --cc=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).