Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Should (t)path = array-unique-special work this way
- X-seq: zsh-workers 37963
- From: Sebastian Gniazdowski <sgniazdowski@xxxxxxxxx>
- To: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- Subject: Re: Should (t)path = array-unique-special work this way
- Date: Sun, 14 Feb 2016 11:04:02 +0100
- Cc: Zsh hackers list <zsh-workers@xxxxxxx>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=EQfMUuJQZfPhabn4PYGp8zfDfieaZY2EM41DrIMxCUk=; b=pY7lKlqO8gw0+dfaDgovqVb9GQ+dNBRHQ4Xb/WyC71/g7WBsU19ZYXN0AguCiKaePT 8TToRc1bgYvqgfbdGxpQI64zvhP1kb/566SXCAnNTB9Il8wipttXNbC/gGzaF9h5CqpV gwSYCZwpxmX7IawdNiXsEkt1Su3xJIgNV7A/UBCKS1Ar7/dqxORhahYb3ZkpePsTiNlC iLKEL1JSUU3QcLsCQnnQqcpL9zzwAyj5bNWCUSotZTmBytuyjqdwsSveAN93nRtQZV83 HWJAGlJy3ALhCLhVMIC37Y8hPsZjbQAygZ0SApZZB9fKv3eQbXI7fdDZxSH8Bm6ssY08 5yHw==
- In-reply-to: <160205091543.ZM29723@torch.brasslantern.com>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <CAKc7PVCDHQDc=sby5wGNEtWCA6omFhmP8uPWbsPXwTQv9tDqFw@mail.gmail.com> <160205091543.ZM29723@torch.brasslantern.com>
On 5 February 2016 at 18:15, Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> 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.
% typeset -Ua a
% a=( a a )
% echo ${a[@]}
a
% declare -p > snapshot
% source ./snapshot
% a=( a a )
% echo ${a[@]}
a
% echo ${(t)a}
array-unique
% unset a
% source ./snapshot
% echo ${(t)a}
array
% a=( a a )
% echo ${a[@]}
a a
Best regards,
Sebastian Gniazdowski
Messages sorted by:
Reverse Date,
Date,
Thread,
Author