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 14379 invoked from network); 29 Dec 2020 00:43:48 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 29 Dec 2020 00:43:48 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20200801; t=1609202628; b=LPgZM2glD0TTlFRh43u+CtTbyEk6EN26dLu5ghkJIvN8VA50j2lpiX/l4A63kRGKhSGe187qtf x3tdzOvc1p8W/7J2eXp9AejPWMVvryjoKQ8AHlq003nCm8EyQ3AU7CnZvqYV/bXBy0ehNfTAyi Rlv1T6Ng5hzI3jKwRLAdvRaMkX7219eES1Qyu9TDNtaafcJIc5W7IjJZQywTcVbY/HPz+dlWvy ZwheVBkoyngdEHVDiKsYgqWYkEeigBuI0OMhd8ZzLt5U5Jsn2lb1W8PKILFtSRQABqJwoTnv6f u4+E+aUxzcyDwos77W3wFueSL0xWnU2PWzz/+ACaSX2njw==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-wm1-f45.google.com) smtp.remote-ip=209.85.128.45; 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=1609202628; bh=PtOkzDnSBPg5QMEzB97ua3iHCG0DUzFsuXP7FhZP2wU=; 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=GXQSabLc2EvOgIs0/3myWpMOn16+fbBN7RyRvfVuhX34neE7YmYpJStkrxI0nXolq7hR6anYPW yHiPzTC+CGsuF7N1MCdPIKptr8NXxMG+jX0U5htjEZoVjMTPjxqQZjuBSMGibf+kvCPDFI1v1b 7DxoexM2ADV10mC+IFgnCUpQOkW/4zuJvjQ8BMn6TFup+mhNJCc3qAYMO8OTWhe1ZtY7VS2ujL Z7lLhBu3IvLiNV3IsJo4mxf3w0hdLq+iQkZssxcoLLa0GD3x1NCP7WqHTBe/uZ7c/JlNNuXL1v IEodRT/zd41MMkhCaNcrKOH8gsVcoYTEYZZV0EhJmmnGEA==; 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=iv5k8vnL/xW6FXFveS4OUGHv3s8bS5Xxi6EgFQmXw7M=; b=Xk4OMPXH0qxiDr5tYMd4zJtKcd bQ3rSlc2mxQin8ZqvGjSE/4Hxg9laoqPj6z6PnKGgqK6tIF07k1YDa2gTyEN2hKKgxLUD3VFZR6vf vOg0/sHRqpvG3lbEZMlOdr8j5ylFMdmDkTOPb4n9YMYv1kg1AsO7A2igpkOWbIgExMlMPFvdt7B/6 +i6sPMbUcSje3jt4HPszJPwXtMu3oTHVfM9UNm+y/lKI0Uqu4eUoXoFIc+7WyH9nXEix7lWoY9IsB thjfVAfligtn0vvwYEH3xF3i+yZ3NHAaKx0RfEB4KK9kVZjnHtql/82lsC8iw9Bl12DcBFlr1HoNV 7cwYXf7g==; Received: from authenticated user by zero.zsh.org with local id 1ku374-000L4v-M0; Tue, 29 Dec 2020 00:43:46 +0000 Authentication-Results: zsh.org; iprev=pass (mail-wm1-f45.google.com) smtp.remote-ip=209.85.128.45; dkim=pass header.d=gmail.com header.s=20161025 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none Received: from mail-wm1-f45.google.com ([209.85.128.45]:52261) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1ku36q-000KwF-4w; Tue, 29 Dec 2020 00:43:33 +0000 Received: by mail-wm1-f45.google.com with SMTP id a6so784014wmc.2 for ; Mon, 28 Dec 2020 16:43:32 -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=iv5k8vnL/xW6FXFveS4OUGHv3s8bS5Xxi6EgFQmXw7M=; b=TwcFxJn6/pnZjHf19pGhOFmcM7ZrFYm8KT+Q3EZZXnK2YWVECr2J1aBz5gnkzHLnoI IiaolW9KpaLBcWOhCagWO6Lpe3yxm4Z7lC9LiZwNCa/gZUthkFPNXlo2KJy1tH6PRoy7 hfD0AaHlhpioYg/EM9KTRQx2bje9WUUY95CuI1ZUlTlUilQjnrSk2wg9H6l5ylr0KUqT t/q8GS9JR92GxgDwzGWqkf2PFI2VkY8WnmBAxPLIP0P/STJGs/xGpmbKHJLwiPzmn29Q jYBB3NECXLUjtthd8X9tBlRM+5E1otjvUjMHQ30z98hRyjuEvmi95wafZ724rfK/5ZGB pcJA== 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=iv5k8vnL/xW6FXFveS4OUGHv3s8bS5Xxi6EgFQmXw7M=; b=esQZoo6jHVOgYFlY2Dkgd/ysv7mAfnq9oUQvR2LqbWfuoI8rIlW8FtdXfzlsZVegaT T1kw7TI7XOIToSkfKSdT5P9q93DrIPfM1oTRJaVie+SAw/i+lS2dmvOYiQJhrq8dW4+s 6jeb6T0AFiOzlUgBl/Wb7Oi7reWu+xOUMTwv6YWEIv6JZiUz4MoNkaupYdy+yQkEcVjT UTAVOkLmOmb81cJezjVEgqt2FfoahfilSchkOM92Q8qTOrB/Q4EvLsJxpNkXjSkyw6SF 0eNBH6c4ci/yqC+LpXLBdMVkvKD9pbNokSzNIDOt8FV4vM+KGuzNKJ0JA1mmQxkZWndc cu/w== X-Gm-Message-State: AOAM532i2erOTJthQNIs71lELHBerXO3iF9ppHQlecfcBnt9nG9Ytirq I0Eyct9m1hwf0e4XTa1Cs/kqAX0Hy7K3q34gcupeCeDprlw= X-Google-Smtp-Source: ABdhPJw8DGBQ2y1gDe63BRZU7y1EVdupxUoLu7aLnkgjouZtlt40/wmK/SkbAHhLhgVRpll12ZSSZUnLJ02YriWaIRg= X-Received: by 2002:a7b:c842:: with SMTP id c2mr1142105wml.100.1609202611809; Mon, 28 Dec 2020 16:43:31 -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 18:43:20 -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: 47778 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 4:53 PM Bart Schaefer wrote: > > 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. Yes, but why PM_IMPLICIT? The word "implicit" means unexpressed, or implied. There's nothing implied about "typeset"; it's expressly declaring a variable. > Unset turns it off because the variable explicitly ceases to exist; > only its scope remains, if it had one. Yes, the variable "ceases to exist", but it's not any less implicit. > > Moreover, implicit what? > > Implicit(ly) whatever-other-flags-are-there. I presume that doesn't apply to PM_INTEGER, PM_LOCAL, or pretty much any flag that is not PM_UNSET. In other words: PM_UNSET is the only flag that can be explicit, or implicit. > > 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". Yes, but that's my point; currently (as in; in master) "valid" variables are implicitly the ones that are !PM_UNSET, now that concept is changing. > 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. OK. So now it only makes sense with PM_UNSET. > > 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. Sure, but PM_NULL can fulfill that purpose perfectly fine (instead of PM_DECLARED). -- Felipe Contreras