bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: zsh style associative array assignment bug


From: Eric Cook
Subject: Re: zsh style associative array assignment bug
Date: Sun, 28 Mar 2021 14:02:44 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1

On 3/28/21 7:02 AM, Oğuz wrote:
As it should be. `[bar]' doesn't qualify as an assignment without an equals 
sign, the shell thinks you're mixing two forms of associative array assignment 
there.

In the new form, that a key is listed inside a compound assignment alone 
implies that it was meant to be assigned a value. In my mind, `a=(foo 123 bar)' 
translates to `a=([foo]=123 [bar]=)'. It makes sense.

That is the point that i am making, in typeset -A ary=([key]=) an explicit 
empty string is the value, but in the case of typeset -A ary=([key]) it was 
historically an error. So why should an key without a value now be acceptable?





reply via email to

[Prev in Thread] Current Thread [Next in Thread]