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.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,UNPARSEABLE_RELAY,URIBL_SBL_A autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 765 invoked from network); 3 Jun 2021 06:13:27 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 3 Jun 2021 06:13:27 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20200801; t=1622700807; b=ykXsbpVJ5HfYnBcVJnr2lpCrrGwLtgKWBjweaIHGS3Al6olx2Y5p64OIqeLEsXyL8kh3C6/izh yG4D/Vpu8xyWOLj+eIWQgc0fXjpU9nhc35YHmVEdpEd4CN6Dw4EmEn+zU/Eu3lFr9d6Sqonbng W8SQ3ALCnm2A5Pw64arUpWE39IpjYj7Kv36EM9If7v9m1BNpTAIHHUcgbX+hqsNt93TmpTEFJS qVYyRsfLWI7uwqsME7ou63y3nyRyvn3ZPcnl571cc8WHJcahp0+xu/Z60ccRGjC/Be7qNWzWkx KeNFit1rMTSDP3wKtddnXbVlQaghCmmV77zMCKB8/7Dr+Q==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-ot1-f48.google.com) smtp.remote-ip=209.85.210.48; 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=1622700807; bh=xxZUPs5y0OOvvx+kvySOkq2kDgzDQkYvBwOoUjeW1h0=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Type:To:Subject:Message-ID:Date:From:In-Reply-To: References:MIME-Version:DKIM-Signature:DKIM-Signature; b=r9ZVQwNXzYbZoZR/Gcxk/pXtkjdm2T23xwOBq0aLeOC1y46f+rY0sb6tMZ0iK2psSgqCidpJve vcaaVCHQ0usKDF70P2+oIhz6/ApUCW7SEqkxnh9FkuKV7fS+DjmzZhyln7N4UOMiLESMNj5PVi 1OhEJbormbcdmnD5uCkZtnXgkzUAT64TK1L1MUhJj4p1FLoatDCunK4/xuoS/INisM2EAIw9P2 ujFHXbq0DDxkxy1AYKA0Fzr+PaOMGVoMpxNHAQ6DORs+Eb8640WhJLaNb4vtksW582k/WdWBcF I2CXhXlQFzcd56KEaeICkoxaD+mZ7rY60ouZW9Xz56NBgw==; 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:To:Subject:Message-ID: Date:From:In-Reply-To:References:MIME-Version:Reply-To:Cc: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=Q1eGzWscIx8cgQGzFJ2T4n2uwhXtGLdcdHmKeq52d5Y=; b=Rvt4kEwfsjamEFwisq3lqE5BdU DQaF441eYJ33Xs5RkW5D6lwyX1ZPUBAFP/iJFRVJBXhTj9ZXdA8vuVZ2i4oLN6/8KSHChCx/6fSN0 peHQgQXl/U+xVzohwewwfO3Y3a6CHjoi7Esp+bOcz2XbUZ9J9R/KmPWKjmgMO4mT3i+1tLjiHgBn3 v6AW8jkDp+/Rhpoc4SZdtgHl0PMx/b90ws8H0mpYXf9IeJcQKmrmJMpAVoi4yoWaLfJqC3b0Bvesx pGfTB4g+D748ywA/SZJmILMJmMKcvBXu1hPjO1oYNXL/A5mHG/lN76BBn9IycPRdIfE/7reDhqcdc gex9D4Cg==; Received: from authenticated user by zero.zsh.org with local id 1logbe-000Dz3-Mi; Thu, 03 Jun 2021 06:13:26 +0000 Authentication-Results: zsh.org; iprev=pass (mail-ot1-f48.google.com) smtp.remote-ip=209.85.210.48; 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-ot1-f48.google.com ([209.85.210.48]:33655) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1logbM-000DgF-Bd; Thu, 03 Jun 2021 06:13:09 +0000 Received: by mail-ot1-f48.google.com with SMTP id q9-20020a9d66490000b02903c741e5b703so3649466otm.0 for ; Wed, 02 Jun 2021 23:13:08 -0700 (PDT) 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; bh=Q1eGzWscIx8cgQGzFJ2T4n2uwhXtGLdcdHmKeq52d5Y=; b=FRSClBSX1X1CFvEiWOGx9PREQ8tdtEBDsg0/P1pjfjMyQy2MUn9kMh+jrBAjIdd4R1 hglyLCIuKlpx+88QbJH4XK2iHan0/8ZKiany3Nm7028nc7yL+DX/Eg6Kg8qU00TjwBhC ov7PAa1NtOWKaKLOPI1Cp8kebfRvmW/9lBtkGiUYSapHvuEam33esiCWvjFhCfH76t4C n34LWMt7kBVD+5oOsQOTx27WHl7SDv2bs8u54wAbNKBKlKQaw3kR/IQudXDwM+/vXkhb WWAoTj6DnC5wTtRz3P1mJZp309cVpfb8OxZhKTHP7VfKXm6aBDw/ZB3azSH60mw5UF/K CwMg== 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; bh=Q1eGzWscIx8cgQGzFJ2T4n2uwhXtGLdcdHmKeq52d5Y=; b=o2qbSyTxNkrgnGAOiU/7danQCGb7P+LRjC9B2sqreUaKw7q/V4FLYvzYgiyaBgyFSa g65LKOAn9KSiHUCXDZ9Pc+VpkcQ8GiTkUI46LTZLd5HkdYVdX89PWJ4Akr5MAhCPeTDN WtEGYpXHzbHDAihOqE6p3ENE7+WClMAbzwuNSi3p61Gxnl51DUoBCVlO97KeNUk3mP9T U4cAMZft4xnGkICYb9d2zIHHCrF/x+2reqiW49yRCsxvQzD8ZxcbBPWY9Ni9UtZ2Snz5 k4LPgCJmRIoHyDXw78dWQQUxm/f66uBXScaJqfkcuJrNmv5AaEgbIk0tPysEuc+4MT62 7Apg== X-Gm-Message-State: AOAM5330IwoSuZ6WVz52r2T24X/5s3e9gVtaqbzewmNScycHMo54AfPL F4aihFLPgH24QaxZgNHsAuBnSiejd2PyQ+/9VWl1yY9YqwAEEQ== X-Google-Smtp-Source: ABdhPJyLIQmiWO1oU1Jdf1vRYDnquPONzfTotj/xiaZ1tJREVtIrEHOcYuGiQLn6J6Xj0m9Mh0mgeGpnsPEeMCxLH/8= X-Received: by 2002:a9d:6c46:: with SMTP id g6mr28442980otq.260.1622700786829; Wed, 02 Jun 2021 23:13:06 -0700 (PDT) MIME-Version: 1.0 References: <20200101140343.qwfx2xaojumuds3d@chaz.gmail.com> <20210430061117.buyhdhky5crqjrf2@chazelas.org> <20210505114521.bemoiekpophssbug@chazelas.org> <20210601053235.b4junj6muuwegl7b@chazelas.org> <20210602091145.xvyymjxdors6kqya@chazelas.org> <20210602142005.b5tw2hj2c6q3psqv@chazelas.org> In-Reply-To: From: Bart Schaefer Date: Wed, 2 Jun 2021 23:12:55 -0700 Message-ID: Subject: Re: [PATCH (not final)] (take three?) unset "array[$anything]" To: Zsh hackers list Content-Type: text/plain; charset="UTF-8" X-Seq: 48998 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: On Wed, Jun 2, 2021 at 7:42 PM Bart Schaefer wrote: > > Also, if you know of good test cases, please try them / send them along. I've now tried all the hash keys from the test harness in https://unix.stackexchange.com/questions/626393/in-zsh-how-do-i-unset-an-arbitrary-associative-array-element/626529#626529 It found a few additional misfires when using the (b) flag with the stripquote variation, but both literal and stripquote worked in the respectively expected ways for all those cases plus some others I had already tried. Furthermore, both of them do approximately as well with the $MATCH pattern from workers/43269 as does the current variation -- the original shell unsets 281 out of 291 keys, the literal variation 280, and the stripquote variation 284. The keys not unset using that pattern are different in each of the three cases, except that they all fail to unset key='\`' ... several of the failures with the literal variation have multiple backslashes, though not always consecutive, and it does fail with key=']' and key='\' which could be important. So, we're probably in pretty safe territory with either choice but in terms of backwards compatibility the stripquote version is slightly ahead.