Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
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
- X-seq: zsh-workers 49155
- From: Oliver Kiddle <opk@xxxxxxx>
- To: Eric Cook <llua@xxxxxxx>
- Cc: zsh-workers@xxxxxxx
- 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
- Date: Fri, 09 Jul 2021 00:05:16 +0200
- Archived-at: <https://zsh.org/workers/49155>
- In-reply-to: <20210705051149.12522-1-llua@gmx.com>
- List-id: <zsh-workers.zsh.org>
- References: <20210705051149.12522-1-llua@gmx.com>
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
Messages sorted by:
Reverse Date,
Date,
Thread,
Author