Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: More rabbit-holes with unset variables
- X-seq: zsh-workers 47626
- From: Felipe Contreras <felipe.contreras@xxxxxxxxx>
- To: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>, Zsh hackers list <zsh-workers@xxxxxxx>, Stephane Chazelas <stephane@xxxxxxxxxxxx>
- Subject: Re: More rabbit-holes with unset variables
- Date: Wed, 25 Nov 2020 16:17:46 -0600
- Archived-at: <https://zsh.org/workers/47626>
- Archived-at: <http://www.zsh.org/sympa/arcsearch_id/zsh-workers/2020-11/CAMP44s0-ki%3DTBzTwnqx10FcTLX4mbphwN88UCx0%2Bh97JTecBWA%40mail.gmail.com>
- Authentication-results: zsh.org; iprev=pass (mail-wr1-f47.google.com) smtp.remote-ip=209.85.221.47; dkim=pass header.d=gmail.com header.s=20161025 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=4ST/aYgSqyc15GumV0WKN/Ab5I/SIOHC4P3P2ksVHu8=; b=nHmETAWdRRpPjWyjqmIJs2Lam4+xHN7KEUzpVWdaRIwRs+sWymBnJWerp36s+yXkkl Y4P7hOoOCHdxgVZYZ1uN2bFARfH4TYm0NVCXPNP+vhfOq9azdOr4xvVJzvUoeVYwmKxj p3wojhQK9Sd3UxBag/0hVVTDDtUKytr26d78FjPXRM7GkVgRC238lwPLJ8Ty8QWo6+B1 wgtk1s+GoNho1F+AKbAN89HvC+h81Xfu6uClhbz3N0KTtAlfuIqOKgNivmRDULu4AZmA WHmWAA7z9qTwpox9PZ1DkErLXH9baVwg+PuweAGk0MD/nOfR9MCIglV61fvQoh/PweDM d3ag==
- In-reply-to: <20201125131921.vay7h3xk5qn4odgg@chazelas.org>
- List-archive: <http://www.zsh.org/sympa/arc/zsh-workers>
- List-help: <mailto:sympa@zsh.org?subject=help>
- List-id: <zsh-workers.zsh.org>
- List-owner: <mailto:zsh-workers-request@zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- List-subscribe: <mailto:sympa@zsh.org?subject=subscribe%20zsh-workers>
- List-unsubscribe: <mailto:sympa@zsh.org?subject=unsubscribe%20zsh-workers>
- References: <CAH+w=7Zag5MG5D=cRS2UMSsqJ0t=iw5MH9j8=HBO1Q77nbs03w@mail.gmail.com> <20201125131921.vay7h3xk5qn4odgg@chazelas.org>
- Sender: zsh-workers-request@xxxxxxx
On Wed, Nov 25, 2020 at 7:19 AM Stephane Chazelas <stephane@xxxxxxxxxxxx> wrote:
>
> 2020-11-24 23:02:05 -0800, Bart Schaefer:
> > I was experimenting with ksh to look deeper into adding behavior to
> > ksh_typeset in zsh, and discovered that this example:
> [...]
>
> Sorry I didn't read the full discussion as I just subscribed to
> the list, but I did have a look at the differences between local
> scope implementations at some point and there are many many
> variations between shells.
>
> I did find zsh was far from being the worst one there.
Yes, but the discussion was about inheritance and the behavior of
unset, not about what we are discussing here.
They did mention the zsh behavior, but that's that's it. I don't think
anyone contested what in my opinion is the natural behavior, which is
described initially in the description:
The variable whose name is specified shall be created as a local
variable with name "name". It
shall inherit its initial value, as well as the exported and
readonly flags, from the variable
with the same name in the surrounding dynamic scope if there is one;
otherwise, the variable is
initially unset. Then, if "=word" is provided, the value of that
local variable shall then be set
to word.
So, the variable is initially unset, *unless* "=word" is provided.
Do you think anyone objected to that behavior?
Cheers.
--
Felipe Contreras
Messages sorted by:
Reverse Date,
Date,
Thread,
Author