Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: [PATCH] declarednull: felipec's approach
- X-seq: zsh-workers 47770
- From: Felipe Contreras <felipe.contreras@xxxxxxxxx>
- To: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- Subject: Re: [PATCH] declarednull: felipec's approach
- Date: Mon, 28 Dec 2020 14:08:56 -0600
- Archived-at: <https://zsh.org/workers/47770>
- Archived-at: <http://www.zsh.org/sympa/arcsearch_id/zsh-workers/2020-12/CAMP44s3J0tWc7LHdjL8kuhBwUpOnpQsPzuVyxVH_PzwP%3DG9w3Q%40mail.gmail.com>
- Authentication-results: zsh.org; iprev=pass (mail-wr1-f46.google.com) smtp.remote-ip=209.85.221.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=IrObWrOWl0lVvfV5h1QTPiYibbHJtCL70VuPHheTWRw=; b=koO3Xjbn92Qp+BPdzN7xLVe+jMHHwn5UWnkksf62kJAiu6GCZZ6vS7KXa/mfffAMMV v9H5Ac6cKO2iV0IEc3x85lgcC+5xrXrjZKR5rjsoNNV1SfMIGQhUDiAvcKCbK22qGkun JVPSeTic+63jfDo/3KC7T9lyVWtUlIqVp7LtZn/zMBui98OCQvehxmmSy7G5OH+EJV6D l2rYe8Jlw4efllUz3FniMXGcHrtuj50X6JBqgvfpubRemxgzV9NN8erao25nYXMcT8Oc cG5MubMcqFo8WoTqiAGn/gvGK9nt3THEva2mPrnpc8GaVW0UtNhkOpe1nixd76hb/EcO St4w==
- In-reply-to: <CAH+w=7Yzvqm0aPzeCvHje-s1CZmPj6CE4QBMTkK29QnhDvm_tA@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=7Yzvqm0aPzeCvHje-s1CZmPj6CE4QBMTkK29QnhDvm_tA@mail.gmail.com>
- Sender: zsh-workers-request@xxxxxxx
On Sun, Dec 27, 2020 at 4:06 PM Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
>
> On Wed, Dec 23, 2020 at 3:47 PM Felipe Contreras
> <felipe.contreras@xxxxxxxxx> wrote:
> >
> > I added a test that shows a discrepancy I found (${(t)var}) but there
> > could be many, may more. I only checked one instance of PM_UNSET.
>
> Here's one that your patch gets (I think) wrong:
>
> ubuntu% setopt posixbuiltins
> ubuntu% () {
> function> readonly foo
> function> typeset -p foo
> function> print x${(t)foo}x
> function> }
> xx
> ubuntu%
>
> (Note "typeset -p" output nothing.) On declarednull without your patch:
>
> ubuntu% setopt posixbuiltins
> ubuntu% () {
> function> readonly foo
> function> typeset -p foo
> function> print x${(t)foo}x
> function> }
> typeset -g -r foo
> xx
> ubuntu%
>
> The typeset output probably comes down to your third hunk in
> Src/params.c (printparamnode), although I'm not certain what the
> correct fix is, and I don't know what's up with ${(t)foo}. The
> behavior with your patch changes if it's done this way:
I see. I would need to check that case.
> 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).
Cheers.
--
Felipe Contreras
Messages sorted by:
Reverse Date,
Date,
Thread,
Author