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 8849 invoked from network); 4 Jun 2021 08:02:20 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 4 Jun 2021 08:02:20 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20200801; t=1622793740; b=DHqhKtgqZxQimvYA7vaDEAlfjhBL6uTCO/VyEJUYUheFR7Xou6x9VBdaR1Mih89Q2Q6fbS/1R9 YVekeQT9yArJIHK1FTt39+0ntUTYznRJgZK0pKe8XZml+NdxRwBh1cR8AT4aGKL/sCUrao1U/Y UiOhgLnjW5MK1wOoKcqxfFmbOZHGQVxd9fey41XgPNLhIkCbXpfnTzw1MWKMOkl1cSGOQNgOOa zWpEpjjSS6NbydFgQEQmq14d4Iix0sHXSjggy5jf9YgkyAmHo4LyaC+RiTlwvGPUsdXtIFl1Xe vZAQ9Y+cTKMbK5Rakl7kT+lGq9KstUknJ6DlCZ8luTJtTA==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (relay11.mail.gandi.net) smtp.remote-ip=217.70.178.231; dmarc=none header.from=chazelas.org; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20200801; t=1622793740; bh=J03E1TnGKqX9P67oGvFZS+XVyekQFrtWt0ZfAzI19g0=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:In-Reply-To:Content-Type:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:DKIM-Signature; b=byq6Rz5ldoePmR+OCqctR2jvtc5GiMkgdpAV22X0EhVX6Unfl1w6lW/qZxT+OH+r+j3L6zZ48W A0FPDpM4reHS1lkJxq67bGHmWtU1wCWZVwPX3yo2HPD0CTrKyAoZVccBsfJ2Y2mITA9D/zUc14 U0fcCTn3qjZwTPZFVtO0QLqxmNPU9dHaXLnCSz+Yu8P+F+U1qLoFIA85/zOctHZ2+kt7Cdi8H4 YELY8VqI4Teh+EGOgOWDu67alndg7PyMu3UU4otv5j5pdw0nBTcaas8Oyu1xvMOJl2zARy1iC0 w2tW1dCCMyMry5TR8b6A4qqW+QC+1PjsZagCLuQ3sjInUw==; 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:In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=XYU1ZeYUEjRt4151Tolr7EtCYdYWlSuHN1BS0Y80jdU=; b=oLZvloSuiUEktrzhcer6PiZTr9 vCSrDGH5Y4Brvj10hsWoxT7ZKz4TXYYv+CTLqRyjNAnxgIfH2n0TgkOzRVJqlbyMorVdM/A5ILN6i xo+fUBdwrgt0pnfxRHlUyrVxCJZk9kNvGhO19P8mXgL9NrxDGKMvREuGK9fdp7TqIrjaNNWDpIDpU PmyS9FZEc8KniBzzkUE1Ner+Chd5xmxN4VzVcoVar8dhnzrf2HWUo97jWlpIxDvCC3E3XJMf07j5u 9HUTMYAQlnuKSUdUBQ7jqy6MkNHYem6KG6JKcfSK6XchAaqRo5sxr7KFjOjxcscMHH7QDKi9KkvHD MEO/5+hg==; Received: from authenticated user by zero.zsh.org with local id 1lp4mZ-00096b-Ry; Fri, 04 Jun 2021 08:02:19 +0000 Authentication-Results: zsh.org; iprev=pass (relay11.mail.gandi.net) smtp.remote-ip=217.70.178.231; dmarc=none header.from=chazelas.org; arc=none Received: from relay11.mail.gandi.net ([217.70.178.231]:55151) by zero.zsh.org with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) id 1lp4mJ-0008nV-1b; Fri, 04 Jun 2021 08:02:03 +0000 Received: (Authenticated sender: stephane@chazelas.org) by relay11.mail.gandi.net (Postfix) with ESMTPSA id ABF19100008; Fri, 4 Jun 2021 08:02:00 +0000 (UTC) Date: Fri, 4 Jun 2021 09:02:00 +0100 From: Stephane Chazelas To: Bart Schaefer Cc: Peter Stephenson , Zsh hackers list Subject: Re: [PATCH (not final)] (take three?) unset "array[$anything]" Message-ID: <20210604080200.pnlzjexcuu3oyjcy@chazelas.org> Mail-Followup-To: Bart Schaefer , Peter Stephenson , Zsh hackers list References: <20210602091145.xvyymjxdors6kqya@chazelas.org> <20210602142005.b5tw2hj2c6q3psqv@chazelas.org> <1629605749.599911.1622710481163@mail2.virginmedia.com> <20210603131347.i7bv7ao7j3hk3a2e@chazelas.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Seq: 49014 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: 2021-06-03 11:12:19 -0700, Bart Schaefer: [...] > > If I understand correctly, the "stripquote" variant is the one > > where the user can do: [...] > > That is where quotes are parsed and removed but otherwise > > serve no purpose. > > I guess you can describe it that way, yes. It also means the lexer, a large and complex bit of code whose behaviour also depends on a the setting of a number of options will end up being exposed to user-supplied data (of the users of the zsh scripts, not just the users of zsh), which adds some level of risk. > > That hardly helps with backward compatibility as users who did > > work around the previous behaviour will still have to adapt > > their work around > > The point of my previous analysis is that they probably will not have > to adapt. Your $MATCH workaround operates correctly with the > stripquote version in nearly as many cases as it currently does (it is > not foolproof for the current shell implementation). If I understand correctly, that quote stripping removes one level of quotes from tokens identified as string tokens provided the lexer succeeded in tokenising the input, so any workaround would have to escape/quote any shell special character to guarantee the lexer succeeds. [...] > I agree that the literal variation is probably the one most useful to > re-apply in cases like read, print -v, etc. Note that read/print -v, etc. is radically different. Currently we can do (reliably): read 'hash[$key]' and can't do (reliably) read "hash[$key]" If we align with whatever solution we pick for unset, we're going to break a lot more scripts. I don't think we can touch those at least in the default mode operation. -- Stephane