Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: [PATCH] declarednull: rename DECLARED to NULL
- X-seq: zsh-workers 47792
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: Felipe Contreras <felipe.contreras@xxxxxxxxx>
- Cc: "zsh-workers@xxxxxxx" <zsh-workers@xxxxxxx>
- Subject: Re: [PATCH] declarednull: rename DECLARED to NULL
- Date: Sun, 3 Jan 2021 10:26:48 -0800
- Archived-at: <https://zsh.org/workers/47792>
- Archived-at: <http://www.zsh.org/sympa/arcsearch_id/zsh-workers/2021-01/CAH%2Bw%3D7ZL0KGcd8b4mmRhMSPuX-bEgMZi5XG7G37vLo1m87GUAg%40mail.gmail.com>
- In-reply-to: <CAMP44s2v4dJJe8XhGfzzvsANMiT25COreKEhuqF3VgEfqSZ4Fg@mail.gmail.com>
- List-id: <zsh-workers.zsh.org>
- References: <20201228221342.136199-1-felipe.contreras@gmail.com> <CAH+w=7aHddgDB9jbKoL2pceNwPM48pF6+V3oiHzd8versYVW7w@mail.gmail.com> <CAMP44s2v4dJJe8XhGfzzvsANMiT25COreKEhuqF3VgEfqSZ4Fg@mail.gmail.com>
On Sat, Jan 2, 2021 at 6:38 PM Felipe Contreras
<felipe.contreras@xxxxxxxxx> wrote:
>
> On Sat, Jan 2, 2021 at 7:18 PM Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
> >
> > if we go all the way back to the original
> > discussion about this, the point was that
> >
> > typeset var
> > print ${var-unset}
> >
> > should output "unset". Correct?
>
> Yes, but that's only *one* of the considerations. It's still not
> perfectly clear what "typeset -p var" should output.
Hmm, sorry, I thought that was a solved problem. Except for some
special cases like "readonly var", I thought it was pretty clear that
"typeset -p var" should output a semantically identical command to
that which declared the variable in the first place. (Assuming
POSIX_BUILTINS, of course.)
> > unset var <- DEFAULT(off), UNSET(on) <- NULL(off)
>
> Nope. The value hasn't changed, it still has the "default" value.
"Default" here does not refer to the value (or at least, not to the
value alone). A different example might be more obvious; if I do
integer var
unset var
then "var" is no longer an integer. That is the default that has changed.
> I think this is playing ring-around-the-rosy; you are trying to find a
> word that signifies that no value has been assigned, even if the
> variable is "set"
No, that's not it. I'm trying to find a word that describes the STATE
of the variable, independent of its value. It happens that the "spec"
that we're importing from posix-ish shells means that this particular
state is always paired with the state of "unset-ness" but regardless
of your arguments of functional equivalence, neither of these states
is an actual value of NULL.
> So It seems your code and my code agree with the behavior of both A
> and B. The only unknown is what A and B mean.
>
> Agreed?
Yes, although I would not say "unknown". More like "unnamed". Also,
your script doesn't observe that "current zsh: B(on)" does not mean
the same thing that "patched zsh: B(on)" means (at least for my patch
and I think for yours).
Messages sorted by:
Reverse Date,
Date,
Thread,
Author