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 17106 invoked from network); 28 Dec 2020 20:23:15 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 28 Dec 2020 20:23:15 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20200801; t=1609186995; b=EgjuKz929Xzyh1sJR3jLmY1DGPA4poXiveO/icc75Ohbne4XEq3nb/10ME0s6P7Oznkp74YuA5 DOygz7m0TToqsGP+BprgT5pollL3CPQVQWGFOvN03DjLAKL1WIpJKf81ejPNv2e99kscgPFQgz +fagZ9nXwvFdQn3nTGRrfYy3oFPOgdWxojJzGURu/3Tc8Tx+4sGBwLjLlpRXlpVNbhLewoIbwl tAxVn7xi5EfFuO9vAkipBXVffHawrvjZF5zJsTDHPESuWMrtCmNuDNeP6WD9bLNrqqlua+9X+G 1UpHqKiqhKYxBziNk3hH3sJGAnWKTO+d+rVgWQWukEuc9w==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-wr1-f52.google.com) smtp.remote-ip=209.85.221.52; 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=1609186995; bh=sSoLzm8pteioJoxUa5fiCoybTl+PnfnfCa//X7VLlGQ=; 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=jPU9ZXnbq9bnJe+yMpBymF3tYG711dsumvGG1Fs1zpKQP4pOtutfNhLCj8kkWBEp6ZL7/DVcoG Nu27XJYAxrc2a2eFhC3q6vlWs5egbTU4W4PiEvLFU4Olg/S44Hjgl/N9ere/Z6+tL2TSfpnsBM CMP3eWg71rKPVCDuEq/YKAKi0sD9WJ8Ibqj3yHVVvaa8OYFdqoj8/pxhDPa1XMjvFY8N4PQmFa s/tZt2JkC0x9O+CIct4HYwgWZezwGZRMIsuVZXJSRspenPGkr3PE6VpdmBd1U+2WJR2rgsFhmp /7o6QKYXsv6kYWSt74/SGAZibmUeQhYAXl/TjIlKzEv9LQ==; 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=u6VVuRl7SnK7OBhs2bWLkH3B5KZLbqsEWreW6+B2Ng8=; b=NCNpiufd4t6o7Ug7IOQxeZcvl4 5DgIkYgZVIHlRR8EQo8B9OezJHqxm0oTDlMrCGHlruzqSQ7IaIG8Vp9MRSo8x5A+XRvJtSWPTI8dD r7viqs2zz2zm1aOgvJ1RDtzpYt0MbAs3NZimlDspi0pJ+GxWqaoJTec9BVUjpKONg4NCDbH/mj51n 07txzPIT+LXHVkyELvBIeq2B+R3lswnxbV92m1I9DeP4LBzG1++UzZyqyxdKMCUWIdzZ8zxvYLTUX YwGRKr4GryTiBHWGZaMZfeo3QiPmfaRMZTinYD9xlJdsgdhOC0BxsfuTmxU82bBDoV9q2LUZvqC+z oHRx3iUQ==; Received: from authenticated user by zero.zsh.org with local id 1ktz2w-000Ci6-N6; Mon, 28 Dec 2020 20:23:14 +0000 Authentication-Results: zsh.org; iprev=pass (mail-wr1-f52.google.com) smtp.remote-ip=209.85.221.52; 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-f52.google.com ([209.85.221.52]:45358) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1ktz2j-000CYR-0c; Mon, 28 Dec 2020 20:23:01 +0000 Received: by mail-wr1-f52.google.com with SMTP id d26so12400880wrb.12 for ; Mon, 28 Dec 2020 12:23:00 -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=u6VVuRl7SnK7OBhs2bWLkH3B5KZLbqsEWreW6+B2Ng8=; b=NGZkTinH+5wwTMq65fiUBMWRRorz+OvyCP/DurLzibgS6SD28wqczQLGDYYERLPXC+ xgGO1fFbD7MQDKlU+U6I1vt/GQCoXrNO1U8VT88fSBO4Ec0Vh5zJtiA7zexrH13nl3DN TQ0uB7Rik4qoZHICHq2mM/dAEWlrBUfq6VnA8VTzzpYvvhag4LYatVDgVDWU/AUW7YJK 6MpegeB/ypfrykzKEZEVi83dwmyHl1/the4wHeCNNnDzLZXUWUExcWsnpep8FPyGWTO0 JOq/zcf7pp7GPtpiWghBsYQ6/AuqEPLqHgtmcNzrXXJXtwsF2TLm9ucUR9s057jLSVM6 aZcg== 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=u6VVuRl7SnK7OBhs2bWLkH3B5KZLbqsEWreW6+B2Ng8=; b=dG/6fbUTogZh/5YCPxbio0WmSE3sKYsuSCIA5gJZ3PJJh6enQztDm3m4GlXIyqWnQa oxNiprkYlY2wvccgADwO6CsSjCokXbVF0MLHINbcjsYYxX1VnOayGMnWMVIKMrQBezfW UbtLTHKqq81rwMr4jCvHphHal8d28+HGOj/fT8p5yPw4JV5CISWH7D4UM5XI+xeiH2Rf cKsk3DEfmBUBW7X6k01lATFcfAa+LK0SE/W9fwuhcztI+8qNas+jShQVPal/jW06yIMa T4d55HmG0Ql+Y6LTC5I8BhVooXqce3fqJs2Vv0v4gfG6G3bREAfgO6HKbvVPMvpouxsb MIsA== X-Gm-Message-State: AOAM530XdFgprhnri69IDm3C1iAas3N21ldt/s+wzNQ75cpI8u8BkmVZ TBNCAfTVS6iv/YsL3Dey9Z+eFytKm7a9TMHY/a1gISAAvC0= X-Google-Smtp-Source: ABdhPJwup6qjVMUUg3EFR30M0veKtWZ9Rojfz1FF+TTNxzKGxTXcxGemMFWkwuC7V3nXcjpJqTCjJKnlcH+TsMwR+uY= X-Received: by 2002:adf:ce90:: with SMTP id r16mr53323952wrn.100.1609186980528; Mon, 28 Dec 2020 12:23:00 -0800 (PST) MIME-Version: 1.0 References: <20201223234711.492603-1-felipe.contreras@gmail.com> In-Reply-To: From: Felipe Contreras Date: Mon, 28 Dec 2020 14:22:49 -0600 Message-ID: Subject: Re: Another push on declarednull branch To: Bart Schaefer Cc: "zsh-workers@zsh.org" Content-Type: text/plain; charset="UTF-8" X-Seq: 47771 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 Sun, Dec 27, 2020 at 5:05 PM Bart Schaefer wrote: > > On Wed, Dec 23, 2020 at 3:47 PM Felipe Contreras > wrote: > > > > In my branch it's actually called PM_NULL because I think semantically > > makes more sense. > > Note I'm not rejecting your diff, just fixing things I overlooked in my own. No worries. My patch was mostly for discussion / exploration purposes. > I OR'd PM_UNSET into PM_DECLAREDNULL because I thought there would be > fewer (and/or less confusing) cases where PM_UNSET had to be ignored > than cases where both PM_UNSET and (new flag) had to be treated as > equivalent, but having found all (hopefully) of the former it's > probably a wash. Maybe you can still generate a simpler patch. > > Alternate names for PM_DECLARED would be welcome. If I could turn > back time, I might use PM_NOTSET, and then PM_NULL == > (PM_NOTSET|PM_UNSET). In fact I already like that enough better that > I'd probably redo it that way before submitting a patch for master. I can recreate the history of the branch as if initially that was the case (I do it all the time in my patches for git). However, I'm still not sure if those values make sense. typeset var In this case PM_NULL, PM_NOTSET, and PM_UNSET are true. typeset var='' In this case all of those are false. typeset var unset var In this case PM_UNSET is true, but PM_NOTSET is false. Why? No value was ever assigned. > > I added a test that shows a discrepancy I found (${(t)var}) > > New push to declarednull branch (tip is now 20e4d07b0) fixes this. > Also added the test from Filipe's patch and another test for readonly > declarations. It's Felipe BTW. Cheers. -- Felipe Contreras