... | ... | @@ -18,7 +18,27 @@ irf_calibration; |
|
|
y(1:4), e_ys, [0, 1];
|
|
|
end;
|
|
|
```
|
|
|
|
|
|
2. The Dynare macro-processor now allows for nested arrays, i.e. defining arrays that contain other arrays. As a consequence, the old ambiguous syntax needed to be replaced by something unambiguous. In Dynare `4.5`, `[1:2]` was equivalent to `1:2`. Both definitions created an array of integers. In Dynare `4.6` this has changed. `1:2` still creates an array of integers, while `[1:2]` will create an array *within *an array. This implies that in most cases the squared brackets around ranges need to be removed if algebra is performed on the array members. For example, in Dynare `4.5` you could sum integers by writing
|
|
|
```
|
|
|
@#define a = 3
|
|
|
@#for i in [1:4]
|
|
|
@#define b = i+a
|
|
|
@#endfor
|
|
|
```
|
|
|
This will not work in Dynare `4.6`, because now your are adding an integer `a` to a an array of integers in `i`. The error message will typically be something along the lines of
|
|
|
```
|
|
|
Macro-processing error: backtrace...
|
|
|
- Type mismatch for operands of + operator
|
|
|
- binary operation: "model_name.mod" line x, col x-xx
|
|
|
```
|
|
|
The correct code in Dynare `4.6` would be
|
|
|
```
|
|
|
@#define a = 3
|
|
|
@#for i in 1:4
|
|
|
@#define b = i+a
|
|
|
@#endfor
|
|
|
```
|
|
|
Note the deleted brackets in the definition of the range `1:4`
|
|
|
|
|
|
## Changes related to Dynare internals
|
|
|
|
... | ... | |