subexpression evaluation and sustitution: internal assignements are not effected
Reported by Enrico SEGRE
-- Bug description --
subexpression evaluation and sustitution: internal assignements are not effected.
-- Scilab error message --
-- How to reproduce the bug --
I'm consciously tweaking scilab's parser logic beyond what it was conceived for,
but I'd like to understand.
-->a=2; type(a) //So far so good
ans =
1.
-->type(disp(a)) //also this is good
2.
ans =
0.
This is good as 1) first disp(a) [subexpression token] is evaluated, its *null*
result assigned to a temporary variable (so I assume), then type(null())==0
[undocumernted but logic]
However:
-->type(a=%t), a
ans =
4.
a =
2.
The internal subexpression a=0 is *not* evaluated. The result of type matches
the RHS.
By the same:
-->sin(a)
ans =
0.9092974
-->sin(a=0)
ans =
0.
-->a
a =
2.