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 7446 invoked from network); 6 Jan 2021 17:34:24 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 6 Jan 2021 17:34:24 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20200801; t=1609954464; b=YgSObo+5KJ3L0KEqtgpAe52FX2LlVN+iQdnBksE9vUmcCMiBcukMuGW1FmD7aAwzxsGvOLG/0T 7A31vp0ozgutq2hIXWifwHG9W0yeDRFt1vCZSJHGt/O/x/CZ64Wrmy3jCHsMzIxG2Dbe5wWybI HnszdMoIKvMaVl8eeRI7nJZ1LJz5INI4DFGI0GPwi+u51voKEcWQ6Z0dz4COOdKyJNwQioy4kt 78viEZP7aG/msjORGdgUMWV1H2GPwxHuAhcYae4ZurRRx4bqfCIBsft/m3NQCmOSYaFQ9s9Zhq tbolwMNVijUvJTMSv0+ba9Z/8qz8DG5DcSnch4rmoJF/HQ==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-oo1-f47.google.com) smtp.remote-ip=209.85.161.47; 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=1609954464; bh=pkNXdLVH7DqdnySBoLdMoPuQqtJ9IkIXogCYX1XpB4Y=; 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=Zhnil3wZIwpD5xwkHAQtvT/jSKHm15AC99zbt6TUM3yz8QWR2EMi0TaVeSpFewcSchSbRyMxuf UI8ndcvjtRSEMFckC/lS7pgzWsv87uw8+txdkqqZWe/4hMGMz9L9ZfKx6JoS88eSAmRzaLPHJs 8Ro2B3qCkwo6NswTgC3j2k7BUbm+89wlaio/ax6Ka1soRhd2sR2gA/TUPkOUsMv7WPiK0q+LpG OnErpRVdf0lKq6qrXevPHhUX6jozc/PxC0s92oJdELqfyHYynJL5/1gbhfz6i/Hl8s6j3/AAg/ 1B9X/XOIFtLpH7QZn5bG8sWlK3x23hxHEtePU8e7erwLUw==; 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=ZXrjUuqkM6u2Yl08LPk66wriSKWIRqJX1Hag102zFXg=; b=pGcFn9Mq1Fa74Y9Y7RJApMX0Ra ENBrf7Qzq8MDF3rgkxKdio4WIZJZSf69bbqQ/x1Pzbtpp/CiGzkab9Znm35lrWX7Xh6o+WhTOTLST tKf6Kek5nhaIydDxqCewh7UfCX3Xs8F60trPfNNLePKxb8PcD9rH832pzdCwWBQn+JJi3I0qhKqAw D4Yctyp5QYO+1/W2luk0svn3qnEFwM9pBY3xCRfEzbaudSAnQZZz+0NegDAaKMgcBWpNPDxqRJACk 72ZnNpVIuqQm6il/SINt0OBOhU6MW/15vUybm8k4eLhYhXl0BpCZV8HzPdYWJ/pdDMxVuUc5BXBRI aW20BuHw==; Received: from authenticated user by zero.zsh.org with local id 1kxChR-000PMI-D6; Wed, 06 Jan 2021 17:34:21 +0000 Authentication-Results: zsh.org; iprev=pass (mail-oo1-f47.google.com) smtp.remote-ip=209.85.161.47; 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-oo1-f47.google.com ([209.85.161.47]:34844) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1kxCh9-000PE9-3O; Wed, 06 Jan 2021 17:34:03 +0000 Received: by mail-oo1-f47.google.com with SMTP id s19so932767oos.2 for ; Wed, 06 Jan 2021 09:34:02 -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=ZXrjUuqkM6u2Yl08LPk66wriSKWIRqJX1Hag102zFXg=; b=WxFqN7iizf+2C492hMhyl+3j60UBNh84jAK1tn3vZNXr7Az/34NNCxHIGCbOagFHy5 xS0Tjw1e2UkpthQrk+3ib9Z++Q+LxYkncRQk+bihoxEpwx2oG904VhdyVimWFoWQRPP2 v8lvUzcgCNpG6OrdLf/EtT65T/f0dJkyKO4/V/N07I6TI2VwXsv4zLvvJjBsoxXNLJJe TiisU6bCJYXxZ33SYDPiZh/sq6NK+R0wawmM2oGkjfLQ72SbLzqLV097JKjBUlFdEPuM uOfEA6Duz2FGUlbMSL6kAsfZcR3EyZKp7Wd1Bhj74ju0SYk23f2Jy2t649xd9jdV3RQg F+Ew== 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=ZXrjUuqkM6u2Yl08LPk66wriSKWIRqJX1Hag102zFXg=; b=kywNaPqtQhA7JfRKuVtSOMV5Pqg4a/kPkaGXLU7GiDZwnpjMkhfdGqbrgohBacxTSj 1j+7tYUuxC4+NqiNyI00PZjwW/UMf+S+qXU7xC0mBzH5F6L+YVyygUv4LB7JXa4poymW xXb4ARQdhByi9S1qLiaavlXtZY/gxTwKMeo/JKH1wMK0uHvUykaPCSKrRO77PLtxGBhb jCWxYuObRYtLeuftrwJmtiF5/cd0FNqQ7OJmRSTuU9bhoi3vM5R+/KpCYKTCobsB59QS tmJ4I+NF+UxiZGGf4SzmB5toNSPQ8xzfBqS10V38jDCUO4BoGHorTis7v/htIVOnz21s 4wtw== X-Gm-Message-State: AOAM530DNzQDVwM5Kn0HOa3QkAJQMEI7q5mp99kj+W4a8jdnHg0Qmppt AB1F4LiVdbd2Z/7OtS+mBondfyN9IdShjf+ItjurtL5CLe0vqw== X-Google-Smtp-Source: ABdhPJygvd9LIbj5NIvDSEXEhklOMdVrCnG3rYKwI+vETHe8kjGSG/d28DTWzk31jbSosOpuCLn5J1DcAumgVcpWM3E= X-Received: by 2002:a4a:520f:: with SMTP id d15mr3476790oob.29.1609954441857; Wed, 06 Jan 2021 09:34:01 -0800 (PST) MIME-Version: 1.0 References: <20201228221342.136199-1-felipe.contreras@gmail.com> <20210104061718.GB14783@tarpaulin.shahaf.local2> <4e9d7283-94fa-4862-ab04-8c3294f3876c@www.fastmail.com> In-Reply-To: <4e9d7283-94fa-4862-ab04-8c3294f3876c@www.fastmail.com> From: Bart Schaefer Date: Wed, 6 Jan 2021 09:33:49 -0800 Message-ID: Subject: Re: [PATCH] declarednull: rename DECLARED to NULL To: Daniel Shahaf Cc: "zsh-workers@zsh.org" Content-Type: text/plain; charset="UTF-8" X-Seq: 47806 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 Wed, Jan 6, 2021 at 8:02 AM Daniel Shahaf wrote: > > Bart Schaefer wrote on Mon, 04 Jan 2021 21:57 +00:00: > > So the "bits that need to be named" are: > > 1) the bit representing "remember that this was declared but no value > > was assigned" > > 2) the combination of that with PM_UNSET that represents "functionally > > behaves like NULL" > > To be clear, (2) would generally be used as testing whether _either_ > PM_UNSET or the bit from #1 is set, right? Most often it's used for changing the value of both bits at once, not testing. The bits are almost always tested independently. > How about, for #1, PM_BEEN_ASSIGNED or PM_INITIALIZED? The latter was already rejected. Both of these arguably describe the opposite of the actual state, that is, PM_HAS_NOT_BEEN_ASSIGNED would be more accurate ... but Felipe has essentially argued that after "unset foo" the variable still has not been assigned, so why clear a bit with that name? PM_DECLARED_BUT_NEITHER_ASSIGNED_NOR_UNSET is just too verbose, and shortening it to just the first word got us into this discussion in the first place. > As to the combination, my first inclination would have been to leave it > unnamed so that it's obvious PM_UNSET is being inspected, but if the > combination merits being named, then perhaps PM_HAS_VALUE(pm). The reason for doing it the way I did is because (I presumed) most cases would never examine bit #1 because they are already examining PM_UNSET by itself. PM_HAS_VALUE(pm) is actually also backwards. It would usually be PM_HAS_NO_VALUE(pm). But there's actually exactly one such test.