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 1871 invoked from network); 28 Dec 2020 22:53:57 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 28 Dec 2020 22:53:57 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20200801; t=1609196037; b=LH3xlYtMphcNpf4FqhkO7NfYlf7rLRxJn+Gz/WRyXFR6DUQGjb9PrFUuLtLJBtllOsxHOQBfdD Fpkc8csH5nryFY6Q8Jgs5UcG4nv2f1s1TM0emQwwfxP3ji4hOtesjv9KIcHG9rt+x9MAWMY9Nm 95YU/bM6Ve6WZLFPIBmtWPgpU1Y+nTy56o5u4FhdpDI51QdbQJ5XIlES9AJ0YlrPfPsyL3qjfr 90QXniwe47t8SaQxGrnL8LTDREWrQsqmWWp5rAUVOO68rjdQSRpXsf7VIHAXvUsD5ObedclYo2 OqI8/yDGVSRDXECtUBhbaIvKOMQTVkFHrOrSy7VSbo1FxA==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-oi1-f172.google.com) smtp.remote-ip=209.85.167.172; 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=1609196037; bh=B3UqlJgqUbaVqPDPsUkZW8jeFmtgtniKSxJnSzDZ8Qg=; 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=lerMlfrntYV1s/HDpvE2f3tlfTfsTM6o+HzAlKdxle0tVO21d/Ydj/VBEYAobeMyi98PM1KzJd OgiQkZhyet6uvV741i28Le2dIesXTHbDE52U8fFf2tzL1bLrOlOMXRm11dNw4ROt7chHzB2CGh qgoKkJjPJSAHd4RO5tvKSd7vQAjKuRh84CHnFoEo2iEEOnybLmbWkXrPBX+lYtIkhwYlvQ09Y8 mkMD0r7FZRyr2HXLDt19TsDxbUl9VEqqqbrv+Nfy6hzJJRzZs85fWtayikSmiPGN0dheM8u3Dt NRq5+yE0cM95xZYriJNOwn1xKWhnGZ4mmmUkb6WTNtapuw==; 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=Pnkww89m1pjgF6sPwMcV+CLBJiQKn5sNifhPawKMQHk=; b=qdL91BH8KVIY7WPv6XyBAU7lVR ak8Y8s6pwS8p4j8Cv489xKYTe6aYEv5DEl4wvfSnKP4tYP9c9A/tgiNw1F3mGTtUBIW6SUqh/Wz0f +tUzgpy5QohSAas3cXYiz2UBHeNzOKkf4HBEjXd3simeo8oGQbrqKedQhq+HZ/2j3T/K1GWIKCPmq RohDITnpOv8Cq8N1qf4xg1nsXlIZZ1b9luolsyfoamxcDXPcwynY16Ec7eunRqemX7itdvhybir0F PnnI80fRL3apF2NAFknvFIjOLKLwsej808YvSUwptCTeuHtMQQgwwTMPxd8WcQi0bsVGUmLIjorev a6dKN0gw==; Received: from authenticated user by zero.zsh.org with local id 1ku1Om-000HfF-Ox; Mon, 28 Dec 2020 22:53:56 +0000 Authentication-Results: zsh.org; iprev=pass (mail-oi1-f172.google.com) smtp.remote-ip=209.85.167.172; 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-oi1-f172.google.com ([209.85.167.172]:39029) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1ku1OV-000HVx-55; Mon, 28 Dec 2020 22:53:40 +0000 Received: by mail-oi1-f172.google.com with SMTP id w124so12970756oia.6 for ; Mon, 28 Dec 2020 14:53:38 -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=Pnkww89m1pjgF6sPwMcV+CLBJiQKn5sNifhPawKMQHk=; b=H30nZG2FX2Q+U47k9EpaH+JDRxAP0t9Su2VnKaV6xzEMpbA9g+U4d0dsFH/KewXj6D kaoR+NH+jIw+kdxG7J9I+0YBHjd2d4L0yONTC2EAinqRv8fR0c9LosAxABezoU45ex/e Ci0eBlNP9D7VYoy6JG72PEl1bNZfrBiTaibzud7lT0wFotu2qYcmYx9YksPodvrGvrvt zF9E4e6ssSRUZRHdUg2iWsyoSuUf1ZYhhsKLAPgoyiEal2O9/66yvNl2S4m3chxLb0/m /lrGSej8CBl6GzEoPN9uMO5QpTQGxDuMx5GqiogFcQVc5EQFCxmJsOo3oe6gvlRZQ+qA kZ9Q== 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=Pnkww89m1pjgF6sPwMcV+CLBJiQKn5sNifhPawKMQHk=; b=LSD4hbKRZCaQEU+DlY/3+taSxy0IdOeMBTVF2QyS87bUNRfpYVFe698b+eyfudPieT 4VZF2cwYAUxO4s0lwIxmTrwiHrW4yBMHfZsEO85f/j2symPQMjbvMtgZhqgk6hJP5SU0 65juVuUkBlXntOw8VNF2yySBKyrUxJg7cnoMLWJa5egdjTlRk2TrRih9aQapV8KbTZmh r3nC/wz4XuJ8Vv52hiqCqB7YVrveFEFJe34Pmyyv5JufseUOKz8AYfFetS4D3ghovhOe dq3GRTN+T7SPysTS0L5pwYAjkixetrhqkFJmVh0UujygcjzcUaIf85G4I/PvejOYE4l3 INig== X-Gm-Message-State: AOAM530P6jl9/Xi/QxfEbu/obSNFqwmr7uryqwlCnnywAU/33E1sjDFm IPgYGebGwxNWroFIzYJawtz73TbwULOAS9sNkU0WdQ== X-Google-Smtp-Source: ABdhPJxrzyuKYM0jX/S+rqjF5nwUre9CALMrYKOMBh5r+0Pf8z8aUrv29z5KeWGcyMXxlhFVMU9v39TjlyACnPv0U5U= X-Received: by 2002:aca:6089:: with SMTP id u131mr752986oib.84.1609196017789; Mon, 28 Dec 2020 14:53:37 -0800 (PST) MIME-Version: 1.0 References: <20201223234711.492603-1-felipe.contreras@gmail.com> In-Reply-To: From: Bart Schaefer Date: Mon, 28 Dec 2020 14:53:26 -0800 Message-ID: Subject: Re: Another push on declarednull branch To: Felipe Contreras Cc: "zsh-workers@zsh.org" Content-Type: text/plain; charset="UTF-8" X-Seq: 47777 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 1:46 PM Felipe Contreras wrote: > > On Mon, Dec 28, 2020 at 2:54 PM Bart Schaefer wrote: > > > > Would it make more sense as PM_IMPLICIT, so PM_NULL = (PM_IMPLICIT|PM_UNSET)? > > It's still the same problem isn't it? Why does typeset turn on > PM_IMPLICIT, and unset off? Typeset turns on PM_IMPLICIT because there's nowhere else that needs to. Unset turns it off because the variable explicitly ceases to exist; only its scope remains, if it had one. > Moreover, implicit what? Implicit(ly) whatever-other-flags-are-there. > The true meaning is PM_UNSET_BUT_VALID, because the only time this > flag does something is when PM_UNSET is on. I don't think "valid" is a significantly more accurate description. $thing is "valid" whether or not you've declared "typeset thing". Anyway, I conceived PM_DECLARED (now for this discussion PM_IMPLICIT) as having a meaning independent of PM_UNSET; for example PM_IMPLICIT|PM_INTEGER means that if you assign to the variable, the value is interpreted as a number. That was before I realized that "unset foo" forgets everything about "foo" except its scope. That is, I began from the position that typeset -f foo unset foo foo=0.3 needed to resurrect foo as a float rather than a string ... but it doesn't, in bash/ksh. Hence unset must erase PM_IMPLICIT along with everything else. > I think that's a clear sign the logic is not correct. > > It's the other way around Unfortunately given the bitwise implementation that condition is much more complicated to test for; the reversal is for convenience. Zsh is full of bitfield-like booleans that mean nothing unless combined with other such booleans.