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 21548 invoked from network); 4 Dec 2020 11:04:47 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 4 Dec 2020 11:04:47 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20200801; t=1607079887; b=RLi1W/ZnyKkIIaU7dYNhKKnalfUH6BVnTRJISnJ4mo532IlFsaCzSzNCslkZpowAKu3wyFER/f MpEh2703lecprpTF7TrZ6HrQEMq6kfU5Iuhk4VSdReQY7TwDLSp1POTc7gm33xaqVoEld2oky0 uxc5Ipl7PhaOsAkSEska/zXnNXOqV36b6ZoasPZ75z1QnmrUZJSbuwyJGxyFhr6m+vnXEeryQa 2kA9eqprpd8zkQArLwK+pMAdJtXvTc3jZw34KTfCqkI3m2IkAgpXCN3eFHWe606gFSEmbcKpP5 YNZKWeZjsCSfVByFSUQUcc68IF0q4z1VQ8huLrwfeNijUQ==; 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=1607079887; bh=sRjKpk0lHwTlxg1hv3ELFe+P2gBclVxqsBKA0mGZMqE=; 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=GdY6jCd4fOjNfPgO0u/2emFTg9VsTVRx3djsQXTycop5QKFDA1rJZTpuD6ftPeQgG+C+ix+m1G Rtb9HB+jF2XOsOdRnngMomBX/ADJxAqGezdUqbdVj223beToNzuA3iBK1t3YoWHLrKVO7BiOVA lxDm76lcUBQuhQTy7CF3VxFp4nbKDQ829hW2E2JrF7XR/8Ll6zwml9aqRRsNvidDPICr9Xx3vq DhRHXyej8O5Hm6zQLfYYCS7YIeiqmra3BOr0SMT4yuHZF6opRWu1CmDUdaiXxcJtKBX0URiCuT zzIe4/9uKBqJ2kxYUaxbSFXdc1uqNqKbCcRbB6dtGgRVdA==; 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=o3LmrA1a7xGC+HTIwACSCSwvztHUn7GJS+6sgC0Rm2c=; b=Ix0+ntLIM5Pyj205U8mUDNdiwB mSNvPjmiSD5njPI4MoWE/vqB92O3yB9/K4qx9StS00D3wJCcPPEYv3AIzoqujOj+zvISeL/fCUCRT AmYRGSmhNNxJne0/I8nkE444HCPbQuedhbvtPoQ6V1Pumhw3DFJtAIW84xhBXBbSW1EJHJol1zGCO 3OTZlV+l3AhOYyHHJi+xDwAf6OrsG8isUbNOCrSyp3HN3eLDRUJlj0TE497D7gqALmty/ahT0Y4FG o9IsIL869pgo+GuhyyxJBIjgmDmzUK+mwEjioE5rgcbYSo4b2fJyekBzTBrB09O9+q5rJ583azaLN Qi1CVHXA==; Received: from authenticated user by zero.zsh.org with local id 1kl8tF-000AMV-Da; Fri, 04 Dec 2020 11:04:41 +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]:35799) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1kl8sw-000ADW-Ts; Fri, 04 Dec 2020 11:04:24 +0000 Received: by mail-wr1-f52.google.com with SMTP id r3so4910124wrt.2 for ; Fri, 04 Dec 2020 03:04:22 -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=o3LmrA1a7xGC+HTIwACSCSwvztHUn7GJS+6sgC0Rm2c=; b=C3+/o6q3+wktoNs9p3DFlSKUpUlUbgVvXwr4l1oJpiQ0a7asysdXdcrj0FvunExRgC 9agkyZlygZKU8Oht9nJpatfCKhh+uqrIlYqn42aEIocBD7LA6oD4IEqi3T6X8w3a26iG 6lWbIO1bSQdXWCxRoLd1buh/OuXynEx+zljzFACbBvr7oAebXlWJVNTwmT8A1gnc4/aB A/4bsgxcSq7POKgLciYRF6rISIDKcxcGwWivVRhjqI1aRX+H08XHNGCMUgoPfrS7uaQB 2k55DEEV+wzdoEiQsum6q96VFhd3aE7FXAWYicm0ulWkuNdJhm+evGl62lbiRWH8lrBB 9O/Q== 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=o3LmrA1a7xGC+HTIwACSCSwvztHUn7GJS+6sgC0Rm2c=; b=eDMlPhVg9R/hY7oGnt1FtCBkHCsjVv+5lnI6m5IvRct8kaYUQoIcCr1Tu9S7plAZ17 lwwoDaJ7PNnUPzegLR+acV1FQNikOb2RoDbFA+wEv/5n7INAzfb1IOmX03jNW7QJ3cn4 gxgtveXGZxUzt5Qb3MaIFmnezHiVzS4UoND7pUDinSg5PoCuIYdi2QbtosgdvQz6rmeR 5OxDpu4zd3ZG+22/LLeIoQ5ZDk/EpXtexSTAe9L0PTRNg41vi/JggJ4HfFbT0HrJtkW8 geVJhpg29/efHb8Q/l00/NQdEyzkSiWXMhL8gjx/ZJ+5TQnBoo+x9DfSgPkg+nRq0BbD YYhg== X-Gm-Message-State: AOAM530A4nlw/DalOrrK5fkRB7RhdKx2qQlAP2Xaw2vK6jHLXrYfKFME QN+gFv1TtkoilsQ4nZIO/bYjUZUH73asU1bv4+PfEENdq1rt1w== X-Google-Smtp-Source: ABdhPJwtfj4utTQBDDKNDBsfqmRu2Jndgj+C5YbDcdnJYT8B8cA+kZByvKx0seeBvD3vhtx5Wdke+vv6tB+bgka0qEg= X-Received: by 2002:a5d:4349:: with SMTP id u9mr4143569wrr.319.1607079862323; Fri, 04 Dec 2020 03:04:22 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Felipe Contreras Date: Fri, 4 Dec 2020 05:04:11 -0600 Message-ID: Subject: Re: One possible answer to typeset vs. unset To: Bart Schaefer Cc: Zsh hackers list Content-Type: text/plain; charset="UTF-8" X-Seq: 47720 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 Thu, Dec 3, 2020 at 3:19 PM Bart Schaefer wrote: > > On Tue, Dec 1, 2020 at 12:55 AM Felipe Contreras > wrote: > > > > I don't know what would be the proper solution for tied variables, but > > I used this hack to make the tests pass: > > I looked at this for a while yesterday evening. My conclusion is that > tied variables are already a bit of a hack. Indeed. It might not be worthwhile to look at them at this point. > Consequently I don't know if your patch would cause a different test > for unset-ness (that hasn't been written yet) to fail, but something > like that patch may be unavoidable. I can't parse that. What would such unset-ness test do? Anyway. I don't see the two approaches particularly different. If nobody can argue that "typeset var" and "typeset -i var" should behave differently (one with no value and the other with value), then some kind of flag like PM_DECLARED would be needed. I'll add that to my approach. Next, I think all the instances in which PM_UNSET is checked should be verified, to see if PM_DECLAREDNULL makes sense in those. I'll do that. Next, we need a way to make sure $empty[(i|I)] returns something sensible (that would be for both approaches). And I think that's it. All that's left is deciding what flag would turn this mode on. Lastly, I don't know if there is any low-hanging fruit, for example; doing the same as bash 5.0 with localvar_inherit and localvar_unset. In my opinion localvar_inherit should also be the default (and presumably that's what POSIX will eventually decide). I don't quite get localvar_unset, but seems to also be a sensible default. Or maybe that's an entirely new topic. Cheers. -- Felipe Contreras