zsh-workers
 help / color / mirror / code / Atom feed
From: Felipe Contreras <felipe.contreras@gmail.com>
To: Bart Schaefer <schaefer@brasslantern.com>
Cc: "zsh-workers@zsh.org" <zsh-workers@zsh.org>
Subject: Re: Another push on declarednull branch
Date: Mon, 28 Dec 2020 14:22:49 -0600	[thread overview]
Message-ID: <CAMP44s02TKNRHr6x5=noKsvxkKKtvUbdDb40_usfOzgn-Gnmbw@mail.gmail.com> (raw)
In-Reply-To: <CAH+w=7ayKmgc3qPWLr8+NHLCmmhcQxo+n=cAO3pyriTjsNpTQQ@mail.gmail.com>

On Sun, Dec 27, 2020 at 5:05 PM Bart Schaefer <schaefer@brasslantern.com> wrote:
>
> On Wed, Dec 23, 2020 at 3:47 PM Felipe Contreras
> <felipe.contreras@gmail.com> 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


  reply	other threads:[~2020-12-28 20:23 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-23 23:47 [PATCH] declarednull: felipec's approach Felipe Contreras
2020-12-27 18:27 ` Bart Schaefer
2020-12-27 22:06 ` Bart Schaefer
2020-12-28 20:08   ` Felipe Contreras
2020-12-28 21:00     ` Bart Schaefer
2020-12-28 21:58       ` Felipe Contreras
2020-12-27 23:04 ` Another push on declarednull branch Bart Schaefer
2020-12-28 20:22   ` Felipe Contreras [this message]
2020-12-28 20:53     ` Bart Schaefer
2020-12-28 21:46       ` Felipe Contreras
2020-12-28 22:53         ` Bart Schaefer
2020-12-29  0:43           ` Felipe Contreras

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAMP44s02TKNRHr6x5=noKsvxkKKtvUbdDb40_usfOzgn-Gnmbw@mail.gmail.com' \
    --to=felipe.contreras@gmail.com \
    --cc=schaefer@brasslantern.com \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).