macroprocessor code that works in 4.5.6 breaks in unstable
The code:
@#define a = 3
@#for i in [1:4]
@#define b = i+a
@#endfor
@{b}
The breaking commit is 5f1465f9d17096baec1df4f29b48b2edd95681cf
The code:
@#define a = 3
@#for i in [1:4]
@#define b = i+a
@#endfor
@{b}
The breaking commit is 5f1465f9d17096baec1df4f29b48b2edd95681cf
This is the consequence of the fact that arrays can be stored inside arrays.
In Dynare 4.5, [1:2]
was the equivalent of 1:2
, and both were creating an array (of integers).
Now, 1:2
still creates an array, while [1:2]
creates an array with an array inside.
I don't really see how we could maintain backward compatibility without making our syntax inconsistent.
So I'd rather not change the macroprocessor, but document this change, and tell people to remove the brackets around ranges.
added macroprocessor label and removed bug label
added documentation label
closed via commit dynare@123049cf
mentioned in commit dynare@febf248f
mentioned in issue dynare#1656 (closed)