Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Bug with unset variables
- X-seq: zsh-workers 47598
- From: Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx>
- To: Felipe Contreras <felipe.contreras@xxxxxxxxx>
- Subject: Re: Bug with unset variables
- Date: Mon, 23 Nov 2020 04:00:03 +0000
- Archived-at: <https://zsh.org/workers/47598>
- Archived-at: <http://www.zsh.org/sympa/arcsearch_id/zsh-workers/2020-11/20201123040003.GB9114%40tarpaulin.shahaf.local2>
- Authentication-results: zsh.org; iprev=pass (out3-smtp.messagingengine.com) smtp.remote-ip=66.111.4.27; dkim=pass header.d=daniel.shahaf.name header.s=fm1 header.a=rsa-sha256; dkim=pass header.d=messagingengine.com header.s=fm1 header.a=rsa-sha256; dmarc=none header.from=daniel.shahaf.name; 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= daniel.shahaf.name; h=date:from:to:cc:subject:message-id :references:mime-version:content-type:content-transfer-encoding :in-reply-to; s=fm1; bh=hGx+CYSXeYCosBXzFlIkmpyoBLsX3ATCykOp/YOH p0g=; b=DePvc2nA4/hEyNy9WdQdEtvTHwQY4tTr0tul/DReZ9owrOBrzUaMJNXg /sPdc2PG0OnAyiZ6oDCIfEUPMwfYKm/JwPhwCRt9VnK54e9p0aZVdFQpdfNWZQml CMe19GKotobZgldPKndHShO/JvWX1BcFxlD17h29ttrtKK7xM4qOfM6omZcteigD dNSD4VJEliwIveyoqCkrRvG8OhQie5paW6bU6cw54Q4TL/7rBpuCkaHwHtJiMkSv wtpzUqPuV+K+cK3W21gtOs/uurzrk4KqD8zZVHtt1LP/kNc3HViFuOLv63HL1YQt 1VzPahinOq+qPoDfTaZjvjLo6C9pUA==
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; bh=hGx+CYSXeYCosBXzFlIkmpyoBLsX3ATCykOp/YOHp 0g=; b=RSv0rMsXjeYIq1Zn63a/ExZQkqil9V61vjYghk1XbWnZqALFOCITAyZQ6 poFQCaxFqXtzFwAz2/FFsK89JcBaZ+I6YLvTSRmsXzHIaQz4eJU4JpG+S/TUrREl zONl1zGR1FhQmURcTVUCJtWVJ2e3udWKrYyIC0yW7ZvUcaAoBUCaYcSl++2Is4Jl fDNxuPrRRQkPQt4S6Q/O3Sz3be7DkcnHA6g+2FlQk8m+wO1Cn9N0pV+uL23HKxAn 60pCZttzAb0GBkKhWKoF+yOxiWEYfOcoi2vRi5XzjRFvdrnBCL1WeVoZO6xNHLhQ p4Fd2pMr0G5C9cYxCNHyNbC6yRksQ==
- In-reply-to: <CAMP44s3LN_1pLcLhTyF696sOMF6SO6gG855ifmPHQ3ry=RKXFw@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: <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>
- Sender: zsh-workers-request@xxxxxxx
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.)
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.)
> > 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.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author