|
From: Peter S <pet...@gm...> - 2017-02-14 17:12:19
|
On 14/02/2017, Dipl. Ing. Sergey G. Brester
<se...@us...> wrote:
>
> I'll try to explain it on `expr {a($i + $k) = 42}`
>
> The algorithm would be:
[...]
> - if we have it - a(expr1) is an array variable
So, if I understand right, your suggestion would treat '$i + $k' as a
sub-expression, and evaluate it, so say if $i = 1 and $k = 1, then the
above line would set 'a(2) = 42'.
With this scheme, how would it be possible to set the literal array
index '1+1' ? Would the index need to be quoted to escape evaluation
as expression?
a) expr { a({1+1}) = 42 } ;# set index '1+1' to 42
b) expr { a("1+1") = 42 } ;# set index '1+1' to 42
If so, then every array index that is not an expression (that includes
every bareword), would need to be quoted...
--Peter
|