zsh-users
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: Ray Andrews <rayandrews@eastlink.ca>
Cc: zsh-users@zsh.org
Subject: Re: Why would I use .namespace.myvar?
Date: Sun, 10 Mar 2024 15:48:32 -0700	[thread overview]
Message-ID: <CAH+w=7bDFOZYJtMy=r6EJaAF1zNeWNdSBnYfGSEfnBizHzjtrQ@mail.gmail.com> (raw)
In-Reply-To: <6c783297-aa25-4ff6-8233-185a281a074f@eastlink.ca>

On Sun, Mar 10, 2024 at 3:16 PM Ray Andrews <rayandrews@eastlink.ca> wrote:
>
> In a sentence or two, what is a namespace and why do we want it?

Quoting the updated FAQ file:

2.9: What is a `namespace' anyway?

  As of this writing, namespaces in zsh are little more than syntactic
  sugar for grouping related parameters.  For example, as of the update
  to PCRE2, the parameters ${.pcre.match} and ${.pcre.subject} are used
  for regular expression substring capture.  The `.pcre.' part is
  the namespace, and when you refer to a parameter that has one, you
  *must* use the `${...}' braces around the name.  Assignments
  are not special, they have the form `.nspace.var=value' as usual.

  Parameters using a namespace have the additional property that, like
  file names beginning with a dot for globbing, they're hidden from
  `typeset' output unless explicitly asked for.


  parent reply	other threads:[~2024-03-10 22:49 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-09 14:30 Stephane Chazelas
2024-03-09 22:58 ` Bart Schaefer
2024-03-10 12:13   ` Stephane Chazelas
2024-03-10 20:08     ` Bart Schaefer
2024-03-10 22:16       ` Ray Andrews
2024-03-10 22:45         ` Lawrence Velázquez
2024-03-10 23:02           ` Ray Andrews
2024-03-10 23:53             ` Mark J. Reed
2024-03-11  2:22               ` Ray Andrews
2024-03-11  2:35                 ` Bart Schaefer
2024-03-11  2:50                   ` Ray Andrews
2024-03-11  7:53               ` Stephane Chazelas
2024-03-10 22:48         ` Bart Schaefer [this message]
2024-03-10 23:14           ` Ray Andrews

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='CAH+w=7bDFOZYJtMy=r6EJaAF1zNeWNdSBnYfGSEfnBizHzjtrQ@mail.gmail.com' \
    --to=schaefer@brasslantern.com \
    --cc=rayandrews@eastlink.ca \
    --cc=zsh-users@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).