Subject: Re: Should (t)path = array-unique-special work this way
From: Sebastian Gniazdowski <[email-masked]>
To: Bart Schaefer <[email-masked]>
Cc: Zsh hackers list <[email-masked]>
Date: Sun, 14 Feb 2016 11:04:02 +0100
List-Id: Zsh Workers List <zsh-workers.zsh.org>

On 5 February 2016 at 18:15, Bart Schaefer <[email-masked]> 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