|
From: Peter da S. <pet...@fl...> - 2017-02-14 21:32:25
|
On 2/14/17, 3:24 PM, "avl" <av...@lo...> wrote:
> Other structures on left side would not be morphed, so {sin(0)+1=1} would actually assign to variable "2.0", but {sin(0)=1} would assign to element 0 of array sin ... weird - and not so much for assigning to sin(0)+1, but for allowing all kinds of expressions to evaluate to the target variable, *except* direct function-calls.
I think it would make more sense for anything that isn’t an “lvalue” to be an error. So:
sin(0)+1 = 1 ;# error
sin(0) = 1 ;# OK
sin = 1 ;# OK
And maybe:
“sin(0)+1” = 1 ;# OK
“sin”(0) = 1 ;# OK
That is the LHS can be:
1. a bareword.
2. a bareword followed by a parenthesized expression.
3. and possibly a quoted string possibly followed by a parenthesized expression.
Probably {...} and “...” should be legitimate quotes.
|