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 13849 invoked from network); 3 Dec 2020 09:18:48 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 3 Dec 2020 09:18:48 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20200801; t=1606987128; b=hucK8E0pVFnIVZ9TpOnMj4nKQomvLiLUYxZZz+N0b2EFtU/ytErhmXr3duBKu+f5SIkW7eGr1r huggQ/qfsGo9RysTU822ig4k5s8AgPh5yPjpSVmCKIAPgoN3qZJ/h2KtPPvxRrjPH3lH0WUM+W swIIXVbArYEa8AAoA1VTKhEK3pHv0V6C8zNb+f1Sb1BbevoQI56L6L/yS5HSeFB4pq+qz51i4C KoCdR0AUUiGIpKaVkbmnNrd8WnyyW6UE5KmQjaVPFAyyvfKXkZs39bnNmrCCJhnXPOoAYzox4i X+JJFFl3+S4EBhYSPKw0vR4KS/Dr+RIvu5TDGw22pjrivg==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-wr1-f66.google.com) smtp.remote-ip=209.85.221.66; 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=1606987128; bh=3K5n76vxWBe7684zzm6oHi2GemEQ7F181lsRomDbqmk=; 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=a5zzy8fFFQQTXlaH8FS3I30PetjzSdysWYdVG8dGx3B0c39yMCtVy8j0FUGSC8NpR4cVToMc50 WNxu9kToi9fTA1pPwQ6xIEfEufPaQNhl4W9CBWovvClk2HeOTqghFVkQH9IR8h8RVaw3boiiDp 2ZJBZuYzHArbfm/8hY/69wpbbv79pkL+annwkumQC/ccykVyYbM46hKWRq1P7v9SPOZYHZn2Rz Qr4a2/fTUY6vOXKvcSp9kDg/GOzTEppgCeki0Jj4m+gx9ioPAeneNYfEudGeofsf5S2gDLavuZ Is9Z1tZUlfodrLzJF8erWvqpPce9TwWFeqSpwHNMpKf4IA==; 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=W5BwCUSUVGk+j3u+a/EMinMWXTnV8k5wcHxjJuWnJ3k=; b=RsQILL6Zl3aZMM/CMsX6xKuQwD B9H7ioVDY9NGCdqfuqZdZTaBVp0hRCPFn7K4uHx+u0aVcjXpGt4Z7WX842aFtQg1Ev93acX+kfA4V CDvTyZxjkZ/ZBiuYkS+KMOrAhkAW6KtuhGF9U3whsakkYPmsdgjvBrlEKYx7HafwqVP1Z/vC6R3p9 uhQ2+uokj40dQpdT8uYj0KnQgP3AdqVaeCcOAm0IWBaCQbTjhQHSG6jUZeV2yWhFz+Tf+PvFyPMoH sWcEvOQBoAr3EW/VVnJSjXuN+H97D3NCNfQcQ2ThsBRMXC797RX1go8nhnNzek5CgxL9kdmCXshVg YYiOx8dw==; Received: from authenticated user by zero.zsh.org with local id 1kkklC-000GFc-30; Thu, 03 Dec 2020 09:18:46 +0000 Authentication-Results: zsh.org; iprev=pass (mail-wr1-f66.google.com) smtp.remote-ip=209.85.221.66; 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-f66.google.com ([209.85.221.66]:46573) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1kkkku-000G6Q-2r; Thu, 03 Dec 2020 09:18:28 +0000 Received: by mail-wr1-f66.google.com with SMTP id g14so1075206wrm.13 for ; Thu, 03 Dec 2020 01:18:27 -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=W5BwCUSUVGk+j3u+a/EMinMWXTnV8k5wcHxjJuWnJ3k=; b=mkai6PsGSdup68Pg/5lhjO8EkxxZ6zhuJpKZN8ygKk39I/rRwKKvC6/EvBs+wHsaew uukn0LTObAR2pXmuSLp7yCE3Z4gLtZW2iDTsGUCMVJ2JcMsvEcfPXQbHTQ+r6yxIcUya 8luD6+LaZAbZDXHH64WHaNw1TVZxy0u1Shy9ULvBtnZJHEOG/yD1vhqN+nPwM1p7tG5Y XnMD/OdYPEl7zMpBjtIoBwP+/eSTKpSPYlQ62Ja02ePqaWVMpLase6cYT6iIi3rZzQ85 GzCH/B8CLYAO9I01kLNOzCrxCJOQXgpu+WJZy3/RSSkQeWyQqoceJKqnMxSAm7LBmARm HGEQ== 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=W5BwCUSUVGk+j3u+a/EMinMWXTnV8k5wcHxjJuWnJ3k=; b=DLaAK4FYIcJXmbFyFao6d5su8o9puyPquCPAf4nfj9xIsmGJsTSTWerWiyYVfyCXYJ 8iEMHEQyVC9DZAe7syKLWap6flpyuD+gWr94uvGL2gfoNfc+vhZMMqCua7p40guqXlRN loWeXnezwbAXaaKuI8JJ7tzARifQuZ8im26LRKOY0EWSIMWmIs4Ai20jaxIQoJCr02kI uDGbdma685dp38IeiQgWIOSBhoHceji04/0DjFb+QAXNeyPLGZFEJD719icz7/CeLVKI HMM+eLDDoyvei5uwbbZ9QTl2Tuw8yCZN9sCCTPIGlowIu5O02rDMwEQv2Ba4hfiKTCJ0 5dzg== X-Gm-Message-State: AOAM530GDWQpZBZ7jUHJD2HVEOtxEGbsYl0Z4s+E0m1pUfD32y7av5gD hSX6TsVC4Y9xEHEfif8+wlnRKkdit5YivVC6iOY= X-Google-Smtp-Source: ABdhPJyRBeL6NUNdUeYSIOcaE1Yk2+2ZLz6IX0n026dHjWzVB+gSn/jIwAi2TgPpLNbH++4aPClM8MJQ+q9YZ59GNS4= X-Received: by 2002:a5d:4349:: with SMTP id u9mr2456094wrr.319.1606987107450; Thu, 03 Dec 2020 01:18:27 -0800 (PST) MIME-Version: 1.0 References: <20201201091342.310763-1-felipe.contreras@gmail.com> In-Reply-To: From: Felipe Contreras Date: Thu, 3 Dec 2020 03:18:16 -0600 Message-ID: Subject: Re: [PATCH] First try of null typeset To: Roman Perepelitsa Cc: Bart Schaefer , "zsh-workers@zsh.org" Content-Type: text/plain; charset="UTF-8" X-Seq: 47718 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 Thu, Dec 3, 2020 at 2:44 AM Roman Perepelitsa wrote: > > On Wed, Dec 2, 2020 at 10:59 PM Felipe Contreras > wrote: > > > > On Wed, Dec 2, 2020 at 12:48 PM Bart Schaefer wrote: > > > > > > Applying the change to integers and floats is one of the reasons I > > > went in the direction I did. > > > > Yes, I suspect that's the way it will eventually have to be done, but > > others argued "typeset -i var" should initialize it to 0. So for those > > my patch already does what is needed. > > I've two opinions here. > > The first is that it's not a good idea to introduce a mode in which > `typeset var` declares an unset variable but `typeset -i var` doesn't. > The motivation for changing the behavior of `typeset var` is to be > more compatible with other shells. However, there is no shell where > `typeset [flag]... var` leaves or doesn't leave the variable unset > depending on flags. That's *one* motivation, it's not the only motivation. Another motivation is to do the right thing, which POSIX after decades of discussion hasn't managed to agree on what is the right thing. If zsh somehow managed to find the right thing, and the right thing is for "typeset -i var" to set a value while "typeset var" doesn't, then that would solve a lot of future problems. Alas, I don't think that's the right thing. > My second opinion on this matter is that it's not a good idea to > change the behavior of `typeset -i var` in native mode with default > options. The benefits (if any) of this change would be too small to > justify braking user code. Agreed, at least not now (maybe the next major version). But it can be changed in some mode(s). -- Felipe Contreras