zsh-users
 help / color / mirror / code / Atom feed
From: Peter Stephenson <p.w.stephenson@ntlworld.com>
To: Zsh Users <zsh-users@zsh.org>
Subject: Re: Tagged parameters
Date: Tue, 15 Aug 2023 09:27:50 +0100 (BST)	[thread overview]
Message-ID: <2084623922.2320579.1692088070247@mail.virginmedia.com> (raw)
In-Reply-To: <CAHLkEDvYWM0c4sHP1-GXopJfMKPXYffH6Xc4oSvSD35MTbCWQg@mail.gmail.com>

> On 15/08/2023 06:51 Marlon Richert <marlon.richert@gmail.com> wrote:
> man zshbuiltins says that `typeset -t` "tags the named parameters",
> but also that "tags have no special meaning to the shell."
> 
> Is there a practical use case for this? Why was this implemented?

It's inherited from ksh.

It's useful if there are certain parameters you want to keep track
of e.g. for debugging, because you can ask the shell to show you all
tagged parameters instead of giving a list.

% typeset -t foo=one bar=two
% typeset -t                
bar=two
foo=one

Saying they have "no special meaning to the shell" is perhaps not a
100% helpful description. since the fact of just having this option
associated with them is itself "special" in the way shown above.

pws


  reply	other threads:[~2023-08-15  8:28 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-15  5:51 Marlon Richert
2023-08-15  8:27 ` Peter Stephenson [this message]
2023-08-15 14:30   ` Ray Andrews
2023-08-15 14:39     ` Peter Stephenson
2023-08-15 15:16       ` Ray Andrews
2023-08-15 17:40         ` Lawrence Velázquez
2023-08-15 18:10           ` Ray Andrews
2023-08-15 22:41             ` Grant Taylor
2023-08-17 23:41               ` Clinton Bunch
2023-08-18  1:10                 ` Bart Schaefer
2023-08-18  4:15                   ` 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=2084623922.2320579.1692088070247@mail.virginmedia.com \
    --to=p.w.stephenson@ntlworld.com \
    --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).