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,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 3501 invoked from network); 8 Jul 2021 22:05:51 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 8 Jul 2021 22:05:51 -0000 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:Message-ID:Date:Content-ID: Content-Type:MIME-Version:Subject:To:References:From:In-reply-to:cc:Reply-To: Content-Transfer-Encoding:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=YOz0ZNCDizY1+wj8eBDoAG9zXGo6xiLcWbetboUSDPg=; b=LUAn719rcXkii+hUNzr1G1lZpp vyB4y+snT2yaqowTMZEDRczFc0cq7ONXTTmKvQJvNRZmPSrJqwsQv4C3LuSvlhZ2ZiS2fwPo5/yji kHfqqcj1l56lqVks2ja7FushrVEuPieRNs4xMM6gwXkDnXz1DrW0fdGpCjvCNbmH4voqQtNkl+MeX wOG2pBWDWGvxSsZJXSCcdkI063exHN6fdhnaN/1GLzY0JWXPug2sL9M6k9O6ywO1ShFIUaiEPVoee iQCPZLtuT+S/8gpOnKK52AjQlbOg+OOuygn++Z0Oevoa2AvdDY7bg8I49CP9XVlDzraqltgAKqkuA pie/maCA==; Received: from authenticated user by zero.zsh.org with local id 1m1c9W-0000wH-FN; Thu, 08 Jul 2021 22:05:50 +0000 Received: from authenticated user by zero.zsh.org with esmtpsa (TLS1.3:TLS_AES_256_GCM_SHA384:256) id 1m1c90-0000en-1b; Thu, 08 Jul 2021 22:05:18 +0000 Received: from [192.168.178.21] (helo=hydra) by mail.kiddle.eu with esmtp(Exim 4.94.2) (envelope-from ) id 1m1c8y-0007Iy-Ok; Fri, 09 Jul 2021 00:05:16 +0200 cc: zsh-workers@zsh.org In-reply-to: <20210705051149.12522-1-llua@gmx.com> From: Oliver Kiddle References: <20210705051149.12522-1-llua@gmx.com> To: Eric Cook Subject: Re: [PATCH] _modutils: fix the testing of -R/--resolve-alias options as it is now, it is always true due to how $+var works with the k subscript flag on associative arrays MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <28082.1625781916.1@hydra> Date: Fri, 09 Jul 2021 00:05:16 +0200 Message-ID: <28083-1625781916.764025@UCY6.UOU6.q2aH> X-Seq: 49155 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 5 Jul, Eric Cook wrote: > % typeset -A foo=(bar baz); print -- ${foo[(k)-R]} - ${+foo[(k)-R]}; typeset -A foo=(bar bar -R qux); print -- ${foo[(k)-R]} - ${+foo[(k)-R]} That change makes sense. Searching the wider code shows many cases where we've done similar tests with opt_args[(i)...|...|... but none with (k). Subscript flags can be easy to make mistakes with. Oliver