Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: [PATCH] declarednull: felipec's approach
- X-seq: zsh-workers 47760
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: Felipe Contreras <felipe.contreras@xxxxxxxxx>
- Subject: Re: [PATCH] declarednull: felipec's approach
- Date: Sun, 27 Dec 2020 10:27:23 -0800
- Archived-at: <https://zsh.org/workers/47760>
- Archived-at: <http://www.zsh.org/sympa/arcsearch_id/zsh-workers/2020-12/CAH%2Bw%3D7ZYXJ2zn3CcZFEeBGKF5aVGu%3Di050QgyFNVTuhVgBe_kQ%40mail.gmail.com>
- Authentication-results: zsh.org; iprev=pass (mail-oi1-f175.google.com) smtp.remote-ip=209.85.167.175; dkim=pass header.d=brasslantern-com.20150623.gappssmtp.com header.s=20150623 header.a=rsa-sha256; dmarc=none header.from=brasslantern.com; arc=none
- Cc: "zsh-workers@xxxxxxx" <zsh-workers@xxxxxxx>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=821rV4YowK62IZtWtZFxLAO28Z6QmDulxaSg33bW5bg=; b=cpkJEGEMHy+m+o6Cpz59mBi8XcClYYec3Mbd24KbluxPwNhWDjr806WDIEym7xW9zE hAbftImyeSzwo0NAYR8ASz4f64QXoopBGGW60oaxL//aBFpN4EnPJcr6T+eH5UsvKpRd YqXMvXr0Vujwis2V+2TYtMxzQw/wCU6FepLItWAr1von27Z9awaJJvFoKm6OBQepbIjR jAIL6ZxOWf6Ts6k0bgeEFWkft9vpGrC6wXmV/Rjzpx8eHOA6u96Mp/TrFIPRG9UFYV1b O/ACFPJN6/7VJS6PlTkAaBsTx0Ge0oKhL/OIsCYQmdStNN7PmszuSfKGDPNkQkudgOBl F81Q==
- In-reply-to: <20201223234711.492603-1-felipe.contreras@gmail.com>
- 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: <20201223234711.492603-1-felipe.contreras@gmail.com>
- Sender: zsh-workers-request@xxxxxxx
On Wed, Dec 23, 2020 at 3:47 PM Felipe Contreras
<felipe.contreras@xxxxxxxxx> wrote:
>
> This patch merges Bart's approach with my approach, and should be
> applied on top of the branch declarednull.
Thanks Filipe, I'll take a closer look at this.
> In my branch it's actually called PM_NULL because I think semantically
> makes more sense.
[...]
>
> Why would this
>
> local var
> var=foobar
>
> remove PM_DELCARED?
I was never especially happy with PM_DECLARED as a name, the real
semantic is "not (yet) assigned" but I couldn't think of a
short/one-word description of that.
> Additionally it's not clear why unset should clear the PM_DECLAREDNULL
> flag.
Because "not (yet) assigned" + "(currently) unset" doesn't mean the
same thing as "(explicitly) unset", in the ksh/bash examples. Yes, it
would have been enough from the bit value standpoint to clear just
PM_DECLARED (since we're about to re-assert PM_UNSET anyway), but I
thought that made the purpose less clear when reading the code.
> I added a test that shows a discrepancy I found (${(t)var})
Ah, thanks, I forgot to go back and revisit that case. There's no
ksh/bash equivalent of (t) so I never reached a conclusion on what the
correct behavior should be.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author