zsh-workers
 help / color / mirror / code / Atom feed
From: Felipe Contreras <felipe.contreras@gmail.com>
To: Bart Schaefer <schaefer@brasslantern.com>
Cc: Roman Perepelitsa <roman.perepelitsa@gmail.com>,
	Zsh hackers list <zsh-workers@zsh.org>
Subject: Re: Bug with unset variables
Date: Mon, 23 Nov 2020 01:26:50 -0600	[thread overview]
Message-ID: <CAMP44s1m3zNAeZ9Gn3XcG0pHeavD9K_eXOjZz3LGoUvdpzucVA@mail.gmail.com> (raw)
In-Reply-To: <CAH+w=7YZQA=vhA=-jVzYLvP_XmrN6f5Ra8TH5LsMrza8GVsKvQ@mail.gmail.com>

On Mon, Nov 23, 2020 at 12:48 AM Bart Schaefer
<schaefer@brasslantern.com> wrote:
>
> On Sat, Nov 21, 2020 at 5:49 PM Felipe Contreras
> <felipe.contreras@gmail.com> wrote:
> >
> > On Tue, Nov 17, 2020 at 2:54 PM Bart Schaefer <schaefer@brasslantern.com> wrote:
> > >
> > > There literally is no concept of "not defined" in the shell language
> > > outside of that implicit ternary; undefined is not a first-class
> > > value.
> >
> > This is a smoke screen.
>
> This statement confuses me.   If you are insinuating that I'm raising
> a point solely for the purpose of obfuscating the discussion, then
> either (a) you haven't been paying attention to anything I've written
> on this mailing list in the past 25 years, or (b) I'm forced to
> believe you're actively attempting to be insulting.

No. A smoke screen screen doesn't have to be intentional.

I am saying X doesn't have anything to do with Y. You are arguing Y,
IMO all that is doing is diverting attention from X.

> > It either is *functionally* the same, or it isn't.
>
> You keep "shouting" that word as if saying it louder is all that's necessary.

Nope. I demonstrated how they are functionally the same with plenty of examples.

> > I was not the one that brought history into the thread. You are the
> > one that brought the history, which by definition cannot be changed.
>
> You asked why zsh's default behavior is what it is; the answer is
> historical practice.

Indeed, and that's all that was needed to answer *that* particular question.

But then you used an historic argument to counter my claim that Zsh
was not consistent. Go look at mid [1] (I don't know how you link to
the archives, which don't seem to be updated).

This is an entirely different matter.

> Unless I've misunderstood something, the subsequent discussion has
> focused on the idea that we should change the default, despite that
> breaking several precedents, because the default behavior is not
> internally consistent, and that the reason it's not consistent is
> because of the notion that unsetting a variable is equivalent to
> assigning it an undefined value.

No. Again, go back to mid [1]. I specifically said:

"Adding a setopt option for the new behavior doesn't break a lot of
existing zsh code."

I argued it makes sense to add a setopt option that turns on the
behavior that a) in my opinion is more consistent, b) is what Bash and
ksh does, and c) is the equivalent of what virtually all languages do.

> Even if we grant the latter, which I don't think everyone does, it
> still doesn't follow that the only consistent choice for the default
> state of a declared variable is unset.

But it does follow. I already presented several arguments, most of
which have not been even addressed at all. Would like me to list them
all in a document so it's clear how they have not been addressed?

> > My understanding of [KSH_TYPESET] is that it changed the behavior of this:
> >
> >     typeset var=$(echo one word)
> >
> > To this:
> >
> >   builtin typeset var=$(echo one word)
>
> No; it changes the former to something closer to
>
>     typeset var="$(echo one word)"
>
> because *without* the option, it was interpreted as
>
> >   typeset var=one word

OK. So it's the other way around.

But this actually sets a precedent for an option that turns on
behavior similar to that of ksh, that eventually becomes the default,
because presumably it eventually made sense.

The same could happen in this case... Eventually.

Either way, I don't see any argument against adding an option (or
reusing) to turn on this behavior.

Cheers.

[1] CAH+w=7ZwyKq_RxM_RXWu42Y-RbCkRtrLTqesfqCmFNc_C_CwoA@mail.gmail.com

-- 
Felipe Contreras


  reply	other threads:[~2020-11-23  7:27 UTC|newest]

Thread overview: 53+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-11 15:57 Felipe Contreras
2020-11-11 16:13 ` Roman Perepelitsa
2020-11-11 16:56   ` Felipe Contreras
2020-11-11 17:02     ` Roman Perepelitsa
2020-11-11 18:03       ` Felipe Contreras
2020-11-11 18:16         ` Roman Perepelitsa
2020-11-11 20:42           ` Felipe Contreras
2020-11-12  0:20             ` Mikael Magnusson
2020-11-12  1:10               ` Felipe Contreras
2020-11-12  8:45             ` Roman Perepelitsa
2020-11-12 10:47               ` Peter Stephenson
2020-11-12 18:48                 ` Bart Schaefer
2020-11-12 19:49                 ` Felipe Contreras
2020-11-12 18:46               ` Felipe Contreras
2020-11-12 19:10                 ` Roman Perepelitsa
2020-11-12 21:08                   ` Felipe Contreras
2020-11-13  8:51                     ` Roman Perepelitsa
2020-11-14  0:52                       ` Felipe Contreras
2020-11-14  5:41                         ` Roman Perepelitsa
2020-11-16 19:41                           ` Felipe Contreras
2020-11-16 20:22                             ` Roman Perepelitsa
2020-11-17 20:28                               ` Felipe Contreras
2020-11-18 22:45                                 ` Daniel Shahaf
2020-11-22  1:20                                   ` Felipe Contreras
2020-11-23  4:00                                     ` Daniel Shahaf
2020-11-23  6:18                                       ` Felipe Contreras
2020-11-19  2:59                                 ` Bart Schaefer
2020-11-22  1:50                                   ` Felipe Contreras
2020-11-17 20:54                             ` Bart Schaefer
2020-11-22  1:49                               ` Felipe Contreras
2020-11-23  6:48                                 ` Bart Schaefer
2020-11-23  7:26                                   ` Felipe Contreras [this message]
2020-11-23 20:26                                     ` Bart Schaefer
2020-11-23 23:39                                       ` Felipe Contreras
2020-11-24  0:52                                         ` Bart Schaefer
2020-11-25  8:46                                           ` Felipe Contreras
2020-11-27 15:44                                             ` Daniel Shahaf
2020-11-27 20:49                                               ` Felipe Contreras
2020-11-27 20:59                                                 ` Daniel Shahaf
2020-11-27 21:33                                                   ` Bart Schaefer
2020-11-27 23:37                                                     ` Daniel Shahaf
2020-11-27 23:45                                                       ` Bart Schaefer
2020-11-28  0:24                                                       ` Bart Schaefer
2020-11-28  7:32                                                         ` Bart Schaefer
2020-11-28 12:05                                                         ` Felipe Contreras
2020-11-12 19:26                 ` Bart Schaefer
2020-11-12 21:48                   ` Felipe Contreras
2020-11-13 22:17                     ` Bart Schaefer
2020-11-14  0:58                       ` Felipe Contreras
2020-11-11 18:36         ` Bart Schaefer
2020-11-11 21:08           ` Felipe Contreras
2020-11-11 17:02     ` Peter Stephenson
2020-11-11 18:05       ` 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=CAMP44s1m3zNAeZ9Gn3XcG0pHeavD9K_eXOjZz3LGoUvdpzucVA@mail.gmail.com \
    --to=felipe.contreras@gmail.com \
    --cc=roman.perepelitsa@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).