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.3 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 24306 invoked from network); 3 Jan 2021 01:18:58 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 3 Jan 2021 01:18:58 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20200801; t=1609636738; b=JTjamfhswRNTAlmUNMspQ8oGtMPJdgwT4XhWyugzO8dmyqbRuAhLNofG40Ml94iqMQGnA400Kp f+XKZFA6JawispzJXRr8OfUyl3KgmuQCssi6ahxDkC9vPMpMmCj+Ldq6zolZMpU310pLdfkXe0 mabk7FqVFYHdPG1444zhWfvZGw6uaF1sOC7GMStqHvqsrTY2kNtXQUSzwbPHDR6NyaVo5VPDjK uBgehXa/rHTJIoSke+KzUy2830W32qSVbIe2vi6x/7536Sedxd99g2kQ7WLQEu689E5s1xLyxL /8oSvZfnRdHgwbr1PZC/c5tdjBErSa8Xx7hfw6TiaZ6AoA==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-ot1-f54.google.com) smtp.remote-ip=209.85.210.54; dkim=pass header.d=brasslantern-com.20150623.gappssmtp.com header.s=20150623 header.a=rsa-sha256; dmarc=none header.from=brasslantern.com; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20200801; t=1609636738; bh=rmHtS1ahrc2YLqvBSv9TM8LiIN5Lp9LlURnaBhIu/wk=; 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=oB1CEK1LH1yw5tm4h5/4Y9Oo2loimld+s4kqd4wPet1cw3MKpkXZ9ndrNbtjrt9WusWuwWc+s4 ZvVll6sVZna8BBvZL769XzmWmkpLqRVDkPLGEXiks7+fEoy03T76dHcvf1HWQZkzuRkCsSHwnM oeEndNjifH17x/TSPHOoSE8uUa37Csn+vEkk7gxsRWbjBq6o6OZbawJ69aiMGIyN+eK9CEwNBu RgZvsvLU4MY9X0FmFZbGTyeNLPpOgoxVv1thM8+44u17zdKM4QVnqc3OrQBDDT+JD2gc6rU+LE eMGf1MzJJXKksR2alWMZTSX1GfR50qM3WlolI2RA6IYZpA==; 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=l9lTiO/lmJOSTp5a+iG2PrxoJbF5Y8d+dH/zCpo0wfM=; b=GVqwCYySotVueN7eLBqDNqpXQ0 W0/Ha/vUoo6vBQvTJAOkpCvX47nQyk+Mitoif49njyq2q7nM6quoskO4i/sxaUlPNQbpQmt7mArmp rpjDPCmJYqUSnDtypy8JawtRBJbGsFsSGnaE/QlahEg1wCpo1iTOVEAj/qk5zmT/KLJpyoXJ/M6NY ySAkT1wYLMf7ralOuYPsKV0JtcC+0kk04sVaJCuoI57WvwDreCRIU/nx/YOuuwprunAp2tdCcdsza HZKnvS3zElc5jJGAGbyHBUiiJvBcYnwrD8Zrz/+5fQniX4f/uOrq5bAASjUqq+b+tLfz18E5riOeX x5zcabdQ==; Received: from authenticated user by zero.zsh.org with local id 1kvs2r-0005nC-Jw; Sun, 03 Jan 2021 01:18:57 +0000 Authentication-Results: zsh.org; iprev=pass (mail-ot1-f54.google.com) smtp.remote-ip=209.85.210.54; dkim=pass header.d=brasslantern-com.20150623.gappssmtp.com header.s=20150623 header.a=rsa-sha256; dmarc=none header.from=brasslantern.com; arc=none Received: from mail-ot1-f54.google.com ([209.85.210.54]:36330) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1kvs2Z-0005dG-Me; Sun, 03 Jan 2021 01:18:41 +0000 Received: by mail-ot1-f54.google.com with SMTP id d20so22896982otl.3 for ; Sat, 02 Jan 2021 17:18:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=l9lTiO/lmJOSTp5a+iG2PrxoJbF5Y8d+dH/zCpo0wfM=; b=iU3bFCFBP1nyymd4rBWOhUP7GIIUDM2hxhc8+3RhIkSNW1mCUqkWF99yql/M3JdOSF 52+Oe0xaFnMAg/TJl34jcZUEHSg/Pc/54cPrg5cq6GbpG/1mnt62Gaxe1f59CVmm/X2m 14rEVRffabyqkEDOA2LMd3V0CTXLduDLaoQ6lppiSSpH2eCFHYEpw7YwJt8oLyj7vU/l ZsRc0NvTBVX43J04Qf4L5Mu45/3GYS6kzrGte60xOuULqI9qxTEEhJLTP8swPAGdTGXY UvIfsfHzuwxWQp3VNzbY2KyqeyJNq15zFVQ9InFgP3snwcw2upiIeUDesrJ/KBJOjti5 PDTw== 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=l9lTiO/lmJOSTp5a+iG2PrxoJbF5Y8d+dH/zCpo0wfM=; b=aCmRcDEf38/DcTDAqVEPq6wt06PFYQa2JQz2LM1bUgUD8y6NImlZvms1iq1HmRczvD C9hh/OGLQ2PkxRunipaF1G757oZ5notaVZujElYs98Ap1zahaLpjE78vowU/7wNhdrrf rDC4pjCFUrgRp7QBDdYfWVx9QIsk416RbxN785GrHIdaaWT/widNsMdActixfeqLw09O /6zMary819SrQ3+xtt5L4JY0UhxB8ePcQoWAFdX4R5JqbCH4k30yR8wpncQTX38756gn GpTYBPMgsM5T6uN/O8kPN/Rn7aRZ8m4YrpRogNQTDb1bfu0WlP1HWmLkl2SeVXy3Q8fs tc7Q== X-Gm-Message-State: AOAM533Ya5ystWnu2FFjH6otznyDu9s8/xcKAJDdyYWmeMsiLz+ArZpE 2EvJtJF8ukWBUGREQTVa9L0fK/0i7Hg488n8zPoyoA== X-Google-Smtp-Source: ABdhPJzAjUbSv7KSOgm7NEJgASE9H5XFNbGiK8i9/roizdZ75M5MzI7Eve6un8k+k2XXGU0hFFqZCUVGx3iGUnLXS+s= X-Received: by 2002:a9d:208a:: with SMTP id x10mr47747803ota.260.1609636718525; Sat, 02 Jan 2021 17:18:38 -0800 (PST) MIME-Version: 1.0 References: <20201228221342.136199-1-felipe.contreras@gmail.com> In-Reply-To: <20201228221342.136199-1-felipe.contreras@gmail.com> From: Bart Schaefer Date: Sat, 2 Jan 2021 17:18:24 -0800 Message-ID: Subject: Re: [PATCH] declarednull: rename DECLARED to NULL To: Felipe Contreras Cc: "zsh-workers@zsh.org" Content-Type: text/plain; charset="UTF-8" X-Seq: 47790 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, Dec 28, 2020 at 2:13 PM Felipe Contreras wrote: > > This way the logic makes more sense: > > typeset var <- NULL(on) > unset var <- NULL(off) > var='' <- NULL(off) > > NULL means: declared, no value, but still valid even with PM_UNSET. > > No functional changes. This is now getting a little bit weedy since only the names are under discussion, but ... if we go all the way back to the original discussion about this, the point was that typeset var print ${var-unset} should output "unset". Correct? Consequently my thought was that PM_UNSET should be assigned for that case. Using your terminology above, NULL(on) implies UNSET(on). To me, that means that if there is a bit pattern named PM_NULL, it should include the bit pattern for PM_UNSET. In retrospect I could just have used PM_NULL instead of PM_DECLAREDNULL but I was seeking to make it obvious that there were two bits in the pattern when it was used as a mask. As one last stab at this, since neither PM_DECLARED nor PM_IMPLIED is satisfactory, what about PM_DEFAULT ? And scrap PM_DECLAREDNULL for just PM_NULL. #define PM_NULL (PM_DEFAULT|PM_UNSET) This yields typeset var <- NULL(on) <- DEFAULT(on), UNSET(on) unset var <- DEFAULT(off), UNSET(on) <- NULL(off) var='' <- DEFAULT(off), UNSET(off) <- NULL(off) ??