Subject: Re: Should (t)path = array-unique-special work this way
From: Bart Schaefer <[email-masked]>
To: Zsh hackers list <[email-masked]>
Date: Sun, 14 Feb 2016 10:44:28 -0800
List-Id: Zsh Workers List <zsh-workers.zsh.org>

On Feb 14, 11:04am, Sebastian Gniazdowski wrote:
}
} Wanted to write a snapshot feature, basically declare -p > snapshot;
} setopt typesetsilent; source ./snapshot, but the omission of -U is
} quite a blocker.

This doesn't work in the general case anyway, because the output of
"typeset -p" (aka "declare -p") doesn't properly reflect local scopes.
That is, if you're in a local scope, sourcing the "declare -p" output
will create all the variables at that local scope, not at the scopes
where they were originally defined.

In fact it's impossible to correctly reconstruct the local and global
scopes because of the runtime dynamic scoping rules.