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: [PATCH] declarednull: felipec's approach
Date: Mon, 28 Dec 2020 15:58:48 -0600	[thread overview]
Message-ID: <CAMP44s3302D3CzVA6VPoJBO3kT0-QJLhJr2eYt7omUVXyW_EbA@mail.gmail.com> (raw)
In-Reply-To: <CAH+w=7a_p+a7ZvS5qQSX=YM_9AJP_t1c+cm=ht9bG-dePknjLg@mail.gmail.com>

On Mon, Dec 28, 2020 at 3:00 PM Bart Schaefer <schaefer@brasslantern.com> wrote:
>
> On Mon, Dec 28, 2020 at 12:09 PM Felipe Contreras
> <felipe.contreras@gmail.com> wrote:
> >
> > On Sun, Dec 27, 2020 at 4:06 PM Bart Schaefer <schaefer@brasslantern.com> wrote:
> > >
> > > On Wed, Dec 23, 2020 at 3:47 PM Felipe Contreras
> > > <felipe.contreras@gmail.com> wrote:
> > > >
> > > One other thing that has me scratching my head about your patch ... I
> > > can't see any reason why it matters that the bit value is (1<<30), but
> > > if I try, for example, overloading (1<<22) as I did for PM_DECLARED,
> > > the argument lists of shell functions stop working.
> >
> > Because some variables have initially the flag PM_DONTIMPORT (1<<22),
> > for example IFS, so it's like initially they don't have any value
> > (i.e. PM_NULL).
>
> Yes, but nothing ever looks at PM_DONTIMPORT after setting up the
> parameter table,

Not PM_DONTIMPORT, but PM_NULL (which have the same value).

> and how did the positional parameters get involved,

static initparam argvparam_pm = IPDEF9("", &pparams, NULL, \
PM_ARRAY|PM_SPECIAL|PM_DONTIMPORT);

> and why does that NOT happen on the "raw" declarednull branch?

Because in that branch you never check PM_DECLARED alone; it's always
with PM_UNSET.

> I guess it has to be something that's not in your diff but that's
> looking for exactly the PM_NULL bit-pattern, such that omitting
> PM_UNSET makes that comparison fail.

Yes.

Perhaps clearing the flag after calling dontimport() would make sense.

-- 
Felipe Contreras


  reply	other threads:[~2020-12-28 21:59 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-23 23:47 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 [this message]
2020-12-27 23:04 ` Another push on declarednull branch Bart Schaefer
2020-12-28 20:22   ` Felipe Contreras
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=CAMP44s3302D3CzVA6VPoJBO3kT0-QJLhJr2eYt7omUVXyW_EbA@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).