Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Bug with unset variables
- X-seq: zsh-workers 47601
- From: Felipe Contreras <felipe.contreras@xxxxxxxxx>
- To: Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx>
- Subject: Re: Bug with unset variables
- Date: Mon, 23 Nov 2020 00:18:05 -0600
- Archived-at: <https://zsh.org/workers/47601>
- Archived-at: <http://www.zsh.org/sympa/arcsearch_id/zsh-workers/2020-11/CAMP44s3wDP3xD2qJE%3DuabGfYTn5_RPjS2JjqmhNKgDpcr5ePFQ%40mail.gmail.com>
- Authentication-results: zsh.org; iprev=pass (mail-wr1-f54.google.com) smtp.remote-ip=209.85.221.54; dkim=pass header.d=gmail.com header.s=20161025 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none
- Cc: Roman Perepelitsa <roman.perepelitsa@xxxxxxxxx>, Zsh hackers list <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:content-transfer-encoding; bh=/iSYDBnVtUE+0i4/e2s83qV+QY81BtKaTp87Ytjdf3I=; b=HYMfOJIYiEl49CcyT2IDi/xurq49RxOE9l4YSUIvHNnyGYBdAa4QIGeUb6KRESi/DK DDvKsOCqy7cBxvFCuWxiyjIxJhIOyF339NcAgTzrQ0nNcl7ARjscq4wjdwahzeYmErAP WSgGAIhkbu/asYvEBM9F3Z3wH6c/2dUwLU8cqytO4F5pIN6m57uwTvwTizsV6AaQHZpB BX0hfEeruYhy+TzyIjutYsFxxcmX7xRfu3bASSs8q9eCbvakKT/0rwUHYYwcwTeDsyQQ KZ+JiZybR8FrBmucYLEa7makMB/+0Io5KiiFTrm4LFLK6T0PtsENEPLuUUnavlOVIFE7 6Ywg==
- In-reply-to: <20201123040003.GB9114@tarpaulin.shahaf.local2>
- 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: <CAN=4vMoPrb3EVmM7T57DpPvWYdndHdiwhqpi-V+5JgGVbdh8qQ@mail.gmail.com> <CAMP44s0bsQ0iZk4652GC2-tOx9OA8PNCtcraGvjkFyzY234uog@mail.gmail.com> <CAN=4vMpdmZti7oAykW_=NW_9aVA2sVMkVd-A=t5oJyCcua4S5A@mail.gmail.com> <CAMP44s15VJnjUmkXg6t2UgbCwN4M37Mfg7_URgvyAv6aVNs1wA@mail.gmail.com> <CAN=4vMqr-MBuzikqkSJEnY5=hW6xjv_TcW_paZV9oKEXnDsmrw@mail.gmail.com> <CAMP44s0sU0B1fQq=BEJV+jp_jtjxpFbz6K=wqNpukLK4i31P4g@mail.gmail.com> <CAN=4vMqtV8PqXf4gy4Xpe1LS-uP+Ryt6PtQ7joj8=ZX0+ydjug@mail.gmail.com> <CAMP44s0RZshy8XR8J7c=9KdJbZzk63_ddmkK9rTXfPU2hKksLw@mail.gmail.com> <20201118224532.769efe4d@tarpaulin.shahaf.local2> <CAMP44s3LN_1pLcLhTyF696sOMF6SO6gG855ifmPHQ3ry=RKXFw@mail.gmail.com> <20201123040003.GB9114@tarpaulin.shahaf.local2>
- Sender: zsh-workers-request@xxxxxxx
On Sun, Nov 22, 2020 at 10:00 PM Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx> wrote:
>
> Felipe Contreras wrote on Sat, Nov 21, 2020 at 19:20:56 -0600:
> > On Wed, Nov 18, 2020 at 4:45 PM Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx> wrote:
> >
> > > Do not argue about a person. Argue about the technical matter at hand.
> >
> > That's what I did. The technical matter was being ignored.
> >
> > > What are A and B?
> >
> > I already explained this multiple times:
> >
> > A: unset foo
> > B: foo = nil
>
> And in Python, A is «del foo»; B is «foo = None»; and they aren't
> equivalent. Actually, more precisely, Python doesn't even *have* a B,
> because Python doesn't have a syntax for declaring a variable without
> a value. (When you write «foo = None», that «None» is not implicitly
> provided by the language.)
Are your A and B functionally the same?
No.
Are my A and B functionally the same?
Yes.
Those are undeniable facts.
> However, I don't see how any of this is an argument in favour of the
> behaviour change you proposed. Other languages' behaviours be what they
> may, they're unlikely to be a good enough reason to break backwards
> compatibility. (For instance, I don't think a proposal to disable null
> elision would be accepted, due to backwards compatibility concerns,
> regardless of how few other languages do null elision.)
I made the claim and I've substantiated it. Others disagreed with the
claim, and argued against it.
If you don't see how the fact that virtually all languages do the same
thing as Bash and ksh is relevant, then don't argue against the claim.
But my claim still stands.
> > > Why does the Python example not use «del» as the "unset" operation?
> >
> > Because it doesn't do the same thing as unset.
> >
> > In shell, this leaves foo declared in a local scope:
> >
> > local foo # declare
> > unset foo # unset
> >
> > In Python, this doesn't:
> >
> > foo = None # declare
> > del foo # undeclare
> >
> > They are *not* functionally the same thing.
>
> In Python, the "declare" operation would be just «pass», or more
> precisely, the removal of any «global foo» declarations… but, again,
> unless this Python discussion somehow bears on a proposed change to zsh,
> I'm not interested in continuing it.
No. That's not how you declare local variables in Python.
If you are not interested in continuing it then don't argue against it.
Either argue against my claim or don't, but you can't have your cake
and eat it too.
Cheers.
--
Felipe Contreras
Messages sorted by:
Reverse Date,
Date,
Thread,
Author