zsh-workers
 help / color / mirror / code / Atom feed
From: Oliver Kiddle <opk@zsh.org>
To: zsh-workers@zsh.org
Subject: Re: [PATCH 1/3] Extended ksh compatibility: namespace parameter syntax
Date: Wed, 24 May 2023 17:57:58 +0200	[thread overview]
Message-ID: <91669-1684943878.854747@fivr.hfcP.0LL-> (raw)
In-Reply-To: <ZGvYU//xw/ZLjWOK@fullerene.field.pennock-tech.net>

Phil Pennock wrote:
> On 2023-05-21 at 21:35 -0700, Bart Schaefer wrote:
> > On Sun, May 21, 2023 at 7:36 PM Mikael Magnusson <mikachu@gmail.com> wrote:
> > > > So, to match the intent of ksh as I understand it:
> > > >  * .identifier.x is always treating identifier as a namespace
> > > >  * identifier.x is always treating identifier as a compound var
> > > >  * this is consistent across assignment LHS and expansion
> > >
> > > Does this mean compound vars can't be namespaced?
> > 
> > No, but it does mean namespaces can't be nested.

That naming system alone wouldn't necessarily preclude nesting of
namespaces if you allow for consecutive runs of dots - something like:

  .identifier..identifier

The current code doesn't allow that and I'm not even remotely suggesting
it should. Namespaces at the top-level only seems fine.

> Bart is (as per 99.9% of the time) correct.  The examples below might
> make it clearer (and are original to me so fine to grab into the test
> suite).  Note though that ksh does have nested collection types, which
> would make full zsh compatibility trickier:

Compatibility with ksh93 has limited value. What is useful should be
priority. As I've mentioned before, my main wish is that we keep our
options open for the compound variable syntax to be nothing more than
an alternative syntax for associative arrays. I'd ideally like it if
we could somehow stick everything the shell has - keymaps, functions,
aliases, options styles etc into the variable hierarchy so that features
like references, scoping etc might be usable with all. The current
associative array syntax is at least compatible with the fact that
functions have different naming rules because you can use
.sh.function[.a/b] for a function named .a/b

While we can't remove the underscore, it isn't necessarily too late for
us to remove completion functions from polluting the global namespace.
There's a lot of pieces that we'd need in place first but it could be
done.

Oliver


      reply	other threads:[~2023-05-24 15:58 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-27  3:56 Bart Schaefer
2023-03-05  9:10 ` Oliver Kiddle
2023-03-05  9:57   ` Sebastian Gniazdowski
2023-03-05 20:20     ` Bart Schaefer
2023-03-05 21:11       ` Bart Schaefer
2023-03-05 20:16   ` Bart Schaefer
2023-03-05 22:24     ` Oliver Kiddle
2023-03-05 22:42       ` Bart Schaefer
2023-05-20  2:05         ` Phil Pennock
2023-05-20  6:54           ` Bart Schaefer
2023-05-20 17:32             ` Phil Pennock
2023-05-22  2:36               ` Mikael Magnusson
2023-05-22  4:35                 ` Bart Schaefer
2023-05-22 21:02                   ` Phil Pennock
2023-05-24 15:57                     ` Oliver Kiddle [this message]

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=91669-1684943878.854747@fivr.hfcP.0LL- \
    --to=opk@zsh.org \
    --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).