OK, guys, this feels odd to ask, but I do not understand the following:
With self.remove(int) I can remove an element from an array.
#let a = (1, 2, 3)
#a.remove(0)
That works perfectly fine and the output type is int.
If I want to add an element to an array - say add the element “4” to a - following the Typst doc (self.push(any)) I would think you’d go for
#a.push(4)
That does not generate an error message, but neither does it render any output. The type of a.push(4) however is none.
For what it’s worth, this is a totally reasonable assumption to make. Almost all typst functions are pure, meaning they can’t modify values outside their scope, see Function Type – Typst Documentation
In particular, all user-defined functions must be pure (though you can make them non-pure through states and counters)