zsh-workers
 help / color / mirror / code / Atom feed
From: Daniel Shahaf <d.s@daniel.shahaf.name>
To: Sebastian Gniazdowski <sgniazdowski@gmail.com>
Cc: Zsh hackers list <zsh-workers@zsh.org>
Subject: Re: Should (t)path = array-unique-special work this way
Date: Sun, 14 Feb 2016 14:34:43 +0000	[thread overview]
Message-ID: <20160214143443.GA6138@tarsus.local2> (raw)
In-Reply-To: <CAKc7PVBrDBe-QQ5=3uC_G_eQSmg1MvSaG8QBdQN3Zn_htHkZmw@mail.gmail.com>

Sebastian Gniazdowski wrote on Sun, Feb 14, 2016 at 11:04:02 +0100:
> On 5 February 2016 at 18:15, Bart Schaefer <schaefer@brasslantern.com> wrote:
> >
> > Q: Why doesn't -U appear in the "declare -p" output?
> > A: Good question.  It doesn't appear for non-special arrays either.  It
> >    may be intentional because -U isn't a POSIX-supported option, but I
> >    suspect it's just an accidental omission.
> 
> Wanted to write a snapshot feature, basically declare -p > snapshot;
> setopt typesetsilent; source ./snapshot, but the omission of -U is
> quite a blocker. Other interesting thing is that typeset -a a doesn't
> fully redefine a, uniqueness still holds if it was present.

If the parameter already exists, 'typeset' will modify it rather than
replace it.  For example, 'typeset x=foo; readonly x; echo $x' prints
'foo' rather than an empty string.

You might need to call 'unset' before calling 'typeset'?  I'm not sure
whether that has any edgecases to beware of.


  parent reply	other threads:[~2016-02-14 14:41 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-05 13:45 Sebastian Gniazdowski
2016-02-05 17:15 ` Bart Schaefer
2016-02-05 17:34   ` Sebastian Gniazdowski
2016-02-05 17:46     ` Peter Stephenson
2016-02-05 18:19       ` Peter Stephenson
2016-02-14 10:04   ` Sebastian Gniazdowski
2016-02-14 10:19     ` Sebastian Gniazdowski
2016-02-14 14:34     ` Daniel Shahaf [this message]
2016-02-14 18:44     ` Bart Schaefer
2016-02-15  8:25       ` Sebastian Gniazdowski

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=20160214143443.GA6138@tarsus.local2 \
    --to=d.s@daniel.shahaf.name \
    --cc=sgniazdowski@gmail.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).