`VALUE` command does not print variable names
Summary
The VALUE
command does not print according to the example in the manual. The variable value is printed, but not its name.
Steps to reproduce
Run the manual example
REAL A=4;
VALUE,VALUE=TABLE(5,#*A);
REAL P1=5;
REAL P2=7;
VALUE,VALUE={P1,P2,P1*P2-3};
What is the current bug behavior?
Current output:
value: = {0,4,8,12,16}
value: = {5,7,32}
What is the expected correct behavior?
Ideal output (also with spaces):
value: {0*A,1*A,2*A,3*A,4*A} = {0, 4, 8, 12, 16}
value: {P1,P2,P1*P2-3} = {5, 7, 32}
Observations
After some debugging I found that this is due to the direct evaluation in the parser after which the equations that are evaluated are no longer in memory (only the variable name of the array VALUE
). An definition (with :=
) gives the correct output.
From the manual:
When the attribute value is a constant or an expression preceded by the delimiter =
it is evaluated immediately and the result is assigned to the attribute as a constant. When the attribute value is an expression preceded by the delimiter :=
the expression is retained and re-evaluated whenever one of its operands changes.
For example:
VALUE,VALUE:=TABLE(5,#*A);
gives:
value: TABLE(1:5:1,(#*A)) = {4,8,12,16,20}
Note that the table output is still different from the manual output.
Possible fixes
No direct evaluation in the VALUE
command, also with the =
delimiter.