I’m probably misunderstanding something. I know that Vectors are mutable (unlike lists). However in this case it seems that vectors referenced by instance properties are in fact immutable?
I think that this is something different than you want:
MyClass: object {
vec = new Vector([1, 2, 3]);
Operator new means make an allocation now and it’s not a declaration but an expression (programming code to be executed and evaluated) which could exist only inside a function. And TADS is helpful and makes the code into a function, so in reality the above really means:
vec()
{
return new Vector([1, 2, 3]);
}
And that is the problem, every time you use vec as a property somewhere, function is actually called and makes another fresh new vector for you. See Eric’s explanation in recent thread: [url]https://intfiction.org/t/agendaitem-isready-is-a-what/6966/1]. Probably you just want something like this:
MyClass: object {
vec: Vector([1, 2, 3]);
(Please note, I actually didn’t tested the code above.)
Another way would be to define the static objects with lists instead
of vectors and convert them to vectors at pre-initialization (in a
PreinitObject). I suspect this is the only way if
templates are used for creating the static objects (templates don’t
support passing vectors as properties, only lists).