From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.4 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 17649 invoked from network); 23 Nov 2020 07:27:19 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 23 Nov 2020 07:27:19 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20200801; t=1606116439; b=D6DeF+Xpd0uxztUyvkIVJxA1QEWM1y8QtIr4HFwPGZhWwfj7HSqJZI/Xt2M7QeC1BaNvi0Lmzf xi5OuQmLOrJsa4nCVBb83hwfWxXIJQF8JAYhDOkuX9oabItt6jSZg38aBkHkH061uzaOQQv534 9IbYhgV1+phReAbD0V5o0WBsIfNO/E7nxqpze3H8EuvnJT6xT2lqDKyVsrdAm0RoGy4J5dIfAp gbmOZ/ftX4/YDquUDJvTRnKVdN68a/2ORRpAAeIFRgRLW3SXtt92EstEeTXlxudRjwMB6bxM6E BsDTWNQ019NOdeM55PnU1B3i+pw5hq+TNaIJ36VZ3PGC7Q==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-wr1-f47.google.com) smtp.remote-ip=209.85.221.47; dkim=pass header.d=gmail.com header.s=20161025 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20200801; t=1606116439; bh=sfL/o14Cn9YOk/fbrBDVBfQk1idFrX0mWzTG99YDiq8=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Type:Cc:To:Subject:Message-ID:Date:From:In-Reply-To: References:MIME-Version:DKIM-Signature:DKIM-Signature; b=rw1xCqaEfvxyMjKkWzZze3dsTVKXYS1zHyRgUqRsrDv3sYEHUyZvdHsIIoy1UNxHhuqtOTA98N BW6m08/B2+MdLfKFGtIPuaieprUROfHIt4ip+8vPfm4DpgQmkRgo2P6/oNxl337m8cSmRpTOpB WRChpXiOj/HXOsCLD2LAba4DKQH98+zB9M8LJ3lXdjldGkdZQ+cL0mG/F9GWR1X57AriMqYi24 t4QRVUe/omaPu3N59r61Ddv+ky1Iw87LqVtCjRz1YG20z+0LC9WUWcSfPWuSAmvFMEUd3OmmGl Yn0aETDe3mrAGIaLKEiXrNIpimlCckaGw5kwZjqM/FfiUA==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20200801; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:Content-Type:Cc:To:Subject:Message-ID :Date:From:In-Reply-To:References:MIME-Version:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=C6VolV7Ob3Bh7lvyYHv/+77eklp0suUi0WyyxcTEFW0=; b=Ukh6bdazBabufhmAK/Oj6t4XZh inGd0XI+54D00dnLxoEuAhmJJMZ0UqPT8Q3HzslrydEsoSulDPRI8Hy9LrbhxN4SdteSE/YUfFPqP hlNSzS85+bPxlXl6GAKRsosH+YzGap+MOFUExvzkdewuEywCD4jcwfwtEpC0a/0M9A9mOYWu9t9td 43O64Zs6WF9avsnrD28DiZ/QIPe/cJFnp2U3/OfdvK6ZkU6LQJZvwCD6pPnT9ANYaZpDlfrEs3YlL DBs5LFxYzENz5n+5WHvSzjNOUx76WM9/FpRfxiIE0pPT/2suObKq94WR4f8yIWWVXz90DgDjc6nJo zq6rPgZg==; Received: from authenticated user by zero.zsh.org with local id 1kh6Fp-0003Xq-Vy; Mon, 23 Nov 2020 07:27:18 +0000 Authentication-Results: zsh.org; iprev=pass (mail-wr1-f47.google.com) smtp.remote-ip=209.85.221.47; dkim=pass header.d=gmail.com header.s=20161025 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none Received: from mail-wr1-f47.google.com ([209.85.221.47]:44096) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1kh6Fa-0003N4-4f; Mon, 23 Nov 2020 07:27:02 +0000 Received: by mail-wr1-f47.google.com with SMTP id 64so4127946wra.11 for ; Sun, 22 Nov 2020 23:27:01 -0800 (PST) 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; bh=C6VolV7Ob3Bh7lvyYHv/+77eklp0suUi0WyyxcTEFW0=; b=cBPNiImkxcvER63kPYO2VVKAKJ5VK7Iw5OmgXO35vH1u8NuwFLtH6UEnIiHBEgsP71 4OD8Ljgd10l6dcn2m7/2yrfNjIATBBnCXTKymG7MQxC3oKqKik2Mn1nmfrRKd5AyeT7n BQghpuDKHZZqli3FVOk3rYkvGJ7Wm8hRBOatowAKqJj7fgLOKgov3byjPtRsDm773ejy QHOavkSW8tn4FC0qL10TlNZH4s5eCQfHNNw0DixEcw1QR1BglMUTc/Zmg/BCvJkAYeo+ ZqsHeSWFjT3fjGA7oTplDA/q0iesBRRjTeSK4mDX2C0zEbOesvoUGzxFnXzcMRaJetvG bsGA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=C6VolV7Ob3Bh7lvyYHv/+77eklp0suUi0WyyxcTEFW0=; b=kNE6+L+PZzimN5JOyKWsG7tGZfEJxNidggrTO+jWUH5CPGVYTzTbAlhgqIpmIeGky+ SyZg88CkebGSTaVOR5hrHSrJc6MaI5HSivaunJNq6mQ/HwugD7Ss2eeymvZ4Z82vQxtz tRzkmppmJXEW7sJbS4LMYpRObOh/LBrF01GaLkhplFFlklvTNqYpqP+5/oxNlhwZjftP /nTBBZl1vSFvCP+0H2Lw7dJs7RNfvhJtSOBA37J5DrHymzxiRbyR3po1aXrb56RpmO0Q AMC+nCwtZfg0aoxPXkp7u0I4zMrhXjwWq4fxpENmDGI0mFACtkJSItljdeL8XU3gB8yu fXxw== X-Gm-Message-State: AOAM530kEejr8qwOVX1d0mPnRW+xzV0GW+fhPpWz5zuwmVIZO+N8hBCB W/luuJ68BUyo3OCfYKm24ra6BimqO6VHKPVRr3Y= X-Google-Smtp-Source: ABdhPJxK7ZPRsRSSWtvW5b1DtQyaZNIWEu1d/4VGEYTcM5+Sgm7tCYMRodud/EHqRT9sb3jp9Ru0aNS4bxxQfyTyAoc= X-Received: by 2002:a5d:67c2:: with SMTP id n2mr8164937wrw.139.1606116421525; Sun, 22 Nov 2020 23:27:01 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Felipe Contreras Date: Mon, 23 Nov 2020 01:26:50 -0600 Message-ID: Subject: Re: Bug with unset variables To: Bart Schaefer Cc: Roman Perepelitsa , Zsh hackers list Content-Type: text/plain; charset="UTF-8" X-Seq: 47606 Archived-At: X-Loop: zsh-workers@zsh.org Errors-To: zsh-workers-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-workers-request@zsh.org X-no-archive: yes List-Id: List-Help: List-Subscribe: List-Unsubscribe: List-Post: List-Owner: List-Archive: Archived-At: On Mon, Nov 23, 2020 at 12:48 AM Bart Schaefer wrote: > > On Sat, Nov 21, 2020 at 5:49 PM Felipe Contreras > wrote: > > > > On Tue, Nov 17, 2020 at 2:54 PM Bart Schaefer 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