[Top][All Lists]

[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 02:37:46 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1

On 3/28/21 12:25 AM, Oğuz wrote:

Why? I think it's better this way.


1) For consistency sake with the shell the idea was borrowed from mostly.
2) Prior to this extension bash required specifying the key and value for
AA assignments, so it seems weird to silently ignore that a value wasn't given 
2.5) I subjectively think passing an odd number of elements to declare is more 
than not to be a mistake that the user would be interested in knowing about.

With the way it is now, you could save a few characters to do a seen array.
$ while read -r key; ... seen+=("$key") ...
but not really much else.

reply via email to

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