bug-bash
[Top][All Lists]
Advanced

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

Re: need ability to tell if array is associative or not - bug?


From: Greg Wooledge
Subject: Re: need ability to tell if array is associative or not - bug?
Date: Fri, 29 Aug 2014 11:51:00 -0400
User-agent: Mutt/1.4.2.3i

On Fri, Aug 29, 2014 at 04:45:30PM +0100, Jason Vas Dias wrote:
>     local value='1.0';

> The end result expression being evaluated:
>     ++ my_array=(['value']='1.0')
> should never involve an arithmetic expression,
> and should be valid regardless if the array is
> associative or not .

Your index is "value".  In a non-associative array, the index is
evaluated in a math context.  In a math context, a thing that CAN be
treated as a variable name IS treated as a variable name, and this
treatment is recursive.

So you are using an index of 1.0, and this causes the error message.



reply via email to

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