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 4266 invoked from network); 1 Jun 2021 16:05:44 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 1 Jun 2021 16:05:44 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20200801; t=1622563544; b=zvsAaAVIDE/KSIKKo4+1vvjixVJoh/NILCPxzDbKzjCxAKF8ByPgfmU8Ecytz3PeTQR0IW2Hqt +m6uhS3Jkv32dvNO6B4e4bFQbskEaumMpuw3mtaMilV1FmqKwWXzTrnLNh1lABYZyv8djzZRvW tXvclNC4Ey2zUspqF2EiLsgAqu7xdOSyu5+U6iKkTThq9oeE9VLSbA8kL+RY0ntrUMOJaKSt+b 6HqLZpRLIivSeNaSu0nVAy4z4aILn+DdQEIv0h7g7yWjpm+uSeSTRaW0SMs5XmaOQWNJF+Tr6Q +rrJtugpY57NRgE69WUdPk3QHydmFsMI+05lKY586HQcjw==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-oi1-f176.google.com) smtp.remote-ip=209.85.167.176; 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=1622563544; bh=Dp/khcUxmFI0gHy8b73sk4XjPK8XPbgFbB2HJezl+zI=; 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=hKdb1Sx/78G23zkeI5X9WSgU7vicoe1F39d8C5aCWMQQWay0UCPsYG3uyTZ7EUrQNxF9F5mynn isTrEEVDuzibWNnbGIBQg6KD6m9olQJjcg2bu6UBgcnd2J4ilUJxdmnAIqr/P80BrEGK73r3Hd JY68S+y7rX3D3j1Tv149KVsEjmmsoE31os8MuqOQ67Kr41ZFx5pIIVfDYqnNX1AsDZtIIlo6eO RvZVn7drpMZ+3mrkXcbcijImpIFa/S+YLkYIdg/HD+5WPNuRUXMynAmkiY/FjBOsCyNDMWbUMK TEVQvrhAW1Uzk8tHCi4chuEgv3XVBflN325U3RDZJNIStw==; 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=ZktLQt55XYXP/nshVF54HjhIvugR7kQLaufeih+H5ZE=; b=Xt65FgQ47m3bY5Iuhco9llXaZ3 upMN8+50fjF2VyFbDWCulZmTtrgJIsY6sEiIH070iOJAOfKPx+/E+doO49qWrgqGFkvRFxJaNXD5r ZB5r6cbXZPQidVio3S5pI9ForXhTjHTHypb747iQo5Kzq/DXmAsKucaWtN/BLRS0vec4s5hp/G+30 7eyYRaMVldfTk81CwTpLbjFmp0qJMtNO5hEfl80k6x1UFlhSgyWlcIjlyeGlEE4NZbTCxAAltBm5V nWs87eATi0dxjKJvvVyUID/y1rlJDJ1xcgIn6TJ166CVY2oWTNmNBaAvSrRObJ7UWh11dCWODKptk 5BD463Sw==; Received: from authenticated user by zero.zsh.org with local id 1lo6ti-0006FR-HS; Tue, 01 Jun 2021 16:05:42 +0000 Authentication-Results: zsh.org; iprev=pass (mail-oi1-f176.google.com) smtp.remote-ip=209.85.167.176; 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-f176.google.com ([209.85.167.176]:46939) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1lo6tS-000600-0a; Tue, 01 Jun 2021 16:05:27 +0000 Received: by mail-oi1-f176.google.com with SMTP id x15so15945271oic.13 for ; Tue, 01 Jun 2021 09:05:25 -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=ZktLQt55XYXP/nshVF54HjhIvugR7kQLaufeih+H5ZE=; b=s493oFifOGCYKfacSSJYjWKFght0+WOasRt7D6oRzlE5hXowNWXa7yjGGYO9QbW7wQ XPMgar6yGtqE3pp7Yzm/6hKbk/u6Mh+M+8RiHl4SiIjf2mfCV8DLDS3uE3UQNBjZc97g hexGDduAtwafWt46IsTFhzPKEfIsa+Em0MZOHAoQtV/n5vNt4riSXSejaOyR1o11GMy4 mo9CxeTPcZ8/jW0UaHHo7yk5UyrdJ7lEvuCTHkpXxTpCbjYFJaLLbQoPFj2DKMEOJjhK qLaN1Kqd6ilEDXVHvFnQmCXPVqTQPBSHFJt1mh3lEk78D/U55pAL/hIofSMd5dwTk1H2 AOaw== 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=ZktLQt55XYXP/nshVF54HjhIvugR7kQLaufeih+H5ZE=; b=qi72ofux4GFqnUjWmZOlN19iMKCLM81z5W4lqjhfuBhmippC8PpXOXideTW+hkT6x8 nkyMgD4swr+UQc6IsjxdAkDtmt0Rxmo9YD7t+pMWedBu8oIO37I7A0KH9TpvGP61oWgx uaIUm0I7SQPmDnQWLvaZX9Qn/FAaAMxyBE+PSxJHmJSU4EOTxT9vTPczAax2XtJy3rNP 8AKFI135zzvxdlu3fxoXe/wKRBsi3igQSkV6+InpfPZRPCQrBo3tnaWLrRTG/YVNsD5u y0JDKsSE5iWHY+CKZKzfVmrkQuC6nW/BZcBPvRa54MHE6CwW8/4Tg+8B5FFZvyuvUAYD TqMg== X-Gm-Message-State: AOAM532oQNZhFuGkpvQ1tKrsyxd2+FPI67aXtJ88n1Mlp4ObeYvN2Ep8 gjPs9p3e3sxrWlPTnuH0XIu9uRuK48i0waF9CUPSH09kBtM= X-Google-Smtp-Source: ABdhPJwtj8UmDwPbTmilXFv2fWcC7sA4G6704HGx/zivZTon39idnBfV/TsrWoi6l5dU8VilPalBHl3Ji7wi1ExFWp8= X-Received: by 2002:a54:4f99:: with SMTP id g25mr488204oiy.132.1622563524253; Tue, 01 Jun 2021 09:05:24 -0700 (PDT) MIME-Version: 1.0 References: <20191216212706.i3xvf6hn5h3jwkjh@chaz.gmail.com> <20191217073846.4usg2hnsk66bhqvl@chaz.gmail.com> <20191217111113.z242f4g6sx7xdwru@chaz.gmail.com> <2ea6feb3-a686-4d83-ab27-6a582424487c@www.fastmail.com> <20200101140343.qwfx2xaojumuds3d@chaz.gmail.com> <20210430061117.buyhdhky5crqjrf2@chazelas.org> <20210505114521.bemoiekpophssbug@chazelas.org> <20210601053235.b4junj6muuwegl7b@chazelas.org> In-Reply-To: <20210601053235.b4junj6muuwegl7b@chazelas.org> From: Bart Schaefer Date: Tue, 1 Jun 2021 09:05:13 -0700 Message-ID: Subject: Re: [PATCH] (?) typeset array[position=index]=value To: Bart Schaefer , Zsh hackers list Content-Type: text/plain; charset="UTF-8" X-Seq: 48979 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 Mon, May 31, 2021 at 10:32 PM Stephane Chazelas wrote: > > While we're at it, could we fix: Wow, that thread from 2016 sort of died out in the middle, at workers/37933. Thanks for reminding me of that thread, though, I should at least examine whether getasg() ought to be using parse_subscript() even though the corresponding parse.c block is using skipparens(). > assoc[]=x > unset 'assoc[]' > etc. > > The former can be worked around with assoc[${-+}]=x or > assoc+=('' x), the latter not AFAICT. The former can also be done with assoc[(e)]=x Whereas most subscript flags are meaningless for unset, we might consider supporting (e) there. I'm not sure whether that would fully address the problem with the other characters, though. The issue with the empty key seems merely to be that the subscript validity test for associative arrays never changed from the one for plain arrays. > [...] unless we're happy to break backward > compatibility and make unset "assoc[$key]" work whatever the > value of $key (unset 'assoc[f\]oo]]' for unset the element of > key 'f\]oo]' for instance) Hm, I'm not sure what backward-compatibility would be broken? Do you mean that scripts that already have work-arounds for the current issue might stop working? That's sort of why I'm thinking about (e). If that flag had to be present in order to get the "whatever the value of $key" behavior, old workarounds would be unchanged.