From: Bart Schaefer <schaefer@brasslantern.com>
To: Felipe Contreras <felipe.contreras@gmail.com>
Cc: "zsh-workers@zsh.org" <zsh-workers@zsh.org>
Subject: Re: [PATCH] declarednull: rename DECLARED to NULL
Date: Sun, 3 Jan 2021 10:26:48 -0800 [thread overview]
Message-ID: <CAH+w=7ZL0KGcd8b4mmRhMSPuX-bEgMZi5XG7G37vLo1m87GUAg@mail.gmail.com> (raw)
In-Reply-To: <CAMP44s2v4dJJe8XhGfzzvsANMiT25COreKEhuqF3VgEfqSZ4Fg@mail.gmail.com>
On Sat, Jan 2, 2021 at 6:38 PM Felipe Contreras
<felipe.contreras@gmail.com> wrote:
>
> On Sat, Jan 2, 2021 at 7:18 PM Bart Schaefer <schaefer@brasslantern.com> 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).
next prev parent reply other threads:[~2021-01-03 18:27 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-28 22:13 Felipe Contreras
2021-01-03 1:18 ` Bart Schaefer
2021-01-03 2:38 ` Felipe Contreras
2021-01-03 18:26 ` Bart Schaefer [this message]
2021-01-04 6:17 ` Daniel Shahaf
2021-01-04 21:57 ` Bart Schaefer
2021-01-06 16:02 ` Daniel Shahaf
2021-01-06 17:33 ` Bart Schaefer
2021-01-07 15:48 ` Daniel Shahaf
2021-01-07 22:29 ` Bart Schaefer
2021-03-27 19:24 ` Lawrence Velázquez
2021-03-27 20:42 ` Bart Schaefer
2021-03-29 0:44 ` Oliver Kiddle
2021-04-10 18:56 ` Bart Schaefer
2021-04-10 21:58 ` Oliver Kiddle
2021-04-10 22:35 ` Bart Schaefer
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='CAH+w=7ZL0KGcd8b4mmRhMSPuX-bEgMZi5XG7G37vLo1m87GUAg@mail.gmail.com' \
--to=schaefer@brasslantern.com \
--cc=felipe.contreras@gmail.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).