Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Another push on declarednull branch
- X-seq: zsh-workers 47774
- From: Felipe Contreras <felipe.contreras@xxxxxxxxx>
- To: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- Subject: Re: Another push on declarednull branch
- Date: Mon, 28 Dec 2020 15:46:40 -0600
- Archived-at: <https://zsh.org/workers/47774>
- Archived-at: <http://www.zsh.org/sympa/arcsearch_id/zsh-workers/2020-12/CAMP44s0jqp%3DirVq7JSFoUtfuj6XsOpur%3Dy4EXNDxneRtH%3DoE4g%40mail.gmail.com>
- Authentication-results: zsh.org; iprev=pass (mail-wm1-f46.google.com) smtp.remote-ip=209.85.128.46; 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=1C+7DMorDYelg+0gR7noj+fbBNzBzgIArcmblyAyC2M=; b=Muy4/k/+0eKxvUVMtPmiVTQwuiNKb8AVlOxqnc9nFoexrJMxPX2lm1pG5My/IGpQqI TDAoGWwTQ2EWYTygVGDtELvadvSoEUrFPnPTdonaCZCvMYLJZw1ZH21SK1ztICV4LmOS cFNEeJQ8aErqDmxuDzY7RKYUUSec1SjF77e64jOHcpABSsCmbe9zRnRk1zOhWSEKLVwt 27qQnaJsKi5AnHxcwo2cGWVM46Vo9Wnc4zSwTC3oBntYCU6Wh+QsWlT685HCxY1XxJZT IL83a4MxJBCsmhRehSzzOk/O0H+xW3mQpFgfim9bACdBAspo3hF9pYeSEYFLTbEubA2G JpQw==
- In-reply-to: <CAH+w=7a9P0+npTgJCzzF1eFt2KFjXNs+fL1K7CFRYiBFEEQTog@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> <CAMP44s02TKNRHr6x5=noKsvxkKKtvUbdDb40_usfOzgn-Gnmbw@mail.gmail.com> <CAH+w=7a9P0+npTgJCzzF1eFt2KFjXNs+fL1K7CFRYiBFEEQTog@mail.gmail.com>
- Sender: zsh-workers-request@xxxxxxx
On Mon, Dec 28, 2020 at 2:54 PM Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
>
> On Mon, Dec 28, 2020 at 12:23 PM Felipe Contreras
> <felipe.contreras@xxxxxxxxx> wrote:
> >
> > On Sun, Dec 27, 2020 at 5:05 PM Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
> > >
> > > 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).
> >
> > However, I'm still not sure if those values make sense.
> >
> > typeset var
> > unset var
> >
> > In this case PM_UNSET is true, but PM_NOTSET is false. Why? No value
> > was ever assigned.
>
> Would it make more sense as PM_IMPLICIT, so PM_NULL = (PM_IMPLICIT|PM_UNSET)?
It's still the same problem isn't it? Why does typeset turn on
PM_IMPLICIT, and unset off?
Moreover, implicit what?
The true meaning is PM_UNSET_BUT_VALID, because the only time this
flag does something is when PM_UNSET is on. So you would have PM_NULL
= (PM_UNSET|PM_UNSET_BUT_VALID).
Then when you check PM_UNSET, you also check !PM_UNSET_BUT_VALID. A
simpler version would be PM_VALID, but when you assign a value,
PM_VALID would be turned off, which doesn't make sense.
I think that's a clear sign the logic is not correct.
It's the other way around:
PM_VALID = !PM_UNSET || PM_NULL
Then PM_NULL is set on typeset, and cleared with unset. Which makes sense.
Then, instead of checking PM_UNSET, you check !PM_VALID, or PM_UNSET
&& !PM_NULL.
> Naming is often a hard problem. Speaking of which:
>
> > It's Felipe BTW.
>
> Apologies. As someone who is often Burt/Bert/Bret/Brat, I know the annoyance.
No worries.
--
Felipe Contreras
Messages sorted by:
Reverse Date,
Date,
Thread,
Author