Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Another push on declarednull branch
- X-seq: zsh-workers 47771
- From: Felipe Contreras <felipe.contreras@xxxxxxxxx>
- To: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- Subject: Re: Another push on declarednull branch
- Date: Mon, 28 Dec 2020 14:22:49 -0600
- Archived-at: <https://zsh.org/workers/47771>
- Archived-at: <http://www.zsh.org/sympa/arcsearch_id/zsh-workers/2020-12/CAMP44s02TKNRHr6x5%3DnoKsvxkKKtvUbdDb40_usfOzgn-Gnmbw%40mail.gmail.com>
- Authentication-results: zsh.org; iprev=pass (mail-wr1-f52.google.com) smtp.remote-ip=209.85.221.52; dkim=pass header.d=gmail.com header.s=20161025 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none
- Cc: "zsh-workers@xxxxxxx" <zsh-workers@xxxxxxx>
- 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 :cc; bh=u6VVuRl7SnK7OBhs2bWLkH3B5KZLbqsEWreW6+B2Ng8=; b=NGZkTinH+5wwTMq65fiUBMWRRorz+OvyCP/DurLzibgS6SD28wqczQLGDYYERLPXC+ xgGO1fFbD7MQDKlU+U6I1vt/GQCoXrNO1U8VT88fSBO4Ec0Vh5zJtiA7zexrH13nl3DN TQ0uB7Rik4qoZHICHq2mM/dAEWlrBUfq6VnA8VTzzpYvvhag4LYatVDgVDWU/AUW7YJK 6MpegeB/ypfrykzKEZEVi83dwmyHl1/the4wHeCNNnDzLZXUWUExcWsnpep8FPyGWTO0 JOq/zcf7pp7GPtpiWghBsYQ6/AuqEPLqHgtmcNzrXXJXtwsF2TLm9ucUR9s057jLSVM6 aZcg==
- In-reply-to: <CAH+w=7ayKmgc3qPWLr8+NHLCmmhcQxo+n=cAO3pyriTjsNpTQQ@mail.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> <CAH+w=7ayKmgc3qPWLr8+NHLCmmhcQxo+n=cAO3pyriTjsNpTQQ@mail.gmail.com>
- Sender: zsh-workers-request@xxxxxxx
On Sun, Dec 27, 2020 at 5:05 PM Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
>
> On Wed, Dec 23, 2020 at 3:47 PM Felipe Contreras
> <felipe.contreras@xxxxxxxxx> wrote:
> >
> > In my branch it's actually called PM_NULL because I think semantically
> > makes more sense.
>
> Note I'm not rejecting your diff, just fixing things I overlooked in my own.
No worries. My patch was mostly for discussion / exploration purposes.
> I OR'd PM_UNSET into PM_DECLAREDNULL because I thought there would be
> fewer (and/or less confusing) cases where PM_UNSET had to be ignored
> than cases where both PM_UNSET and (new flag) had to be treated as
> equivalent, but having found all (hopefully) of the former it's
> probably a wash. Maybe you can still generate a simpler patch.
>
> Alternate names for PM_DECLARED would be welcome. If I could turn
> back time, I might use PM_NOTSET, and then PM_NULL ==
> (PM_NOTSET|PM_UNSET). In fact I already like that enough better that
> I'd probably redo it that way before submitting a patch for master.
I can recreate the history of the branch as if initially that was the
case (I do it all the time in my patches for git).
However, I'm still not sure if those values make sense.
typeset var
In this case PM_NULL, PM_NOTSET, and PM_UNSET are true.
typeset var=''
In this case all of those are false.
typeset var
unset var
In this case PM_UNSET is true, but PM_NOTSET is false. Why? No value
was ever assigned.
> > I added a test that shows a discrepancy I found (${(t)var})
>
> New push to declarednull branch (tip is now 20e4d07b0) fixes this.
> Also added the test from Filipe's patch and another test for readonly
> declarations.
It's Felipe BTW.
Cheers.
--
Felipe Contreras
Messages sorted by:
Reverse Date,
Date,
Thread,
Author