Remove write access operators for small vectors and small matrices in the language
Affection of R^d
or R^dxd
component values has been in the language for quite a while.
Actually, it is a bad thing for the design of the pugs language, for to reasons:
- since this functionality has been implemented, it seems we never found a use case where it is necessary
- it breaks the possibility to ensure that all variables in the language are properly defines Moreover, the following code does not behave the same way according to the build type (Release or Debug), and this is not something that we want if the bug comes from the language part.
let r:R^3;
r[0] = 1;
With a Release build, the variable r
can contain be (1,0,0)
, since the two last values of r
are not initialized. In Debug mode, it is always (1,nan,nan)
.
Getting ride of this operator allow to ensure that all language variables are correctly initialized and does not reduce language expressivity. Assuming that r
has been properly defined (declared+initialized) as an R^3
, one will still be able to write
r = (1, r[1], r[2]);