Hello there,
I noticed that when using a push function from a module into another function I get the error “variables from outside the function are read-only and cannot be modified”.
Here is a minimal exemple.
First a module “module.typ”:
#let push() = [
This is a dummy function
]
Then try to use it in another module and in a function, for instance a “call.typ” module:
#import "module.typ" as m
#m.push() //no problem there
#let mycall() = {
m.push() //here is the error
}
#mycall()
The exact error is:
error: variables from outside the function are read-only and cannot be modified
┌─ call.typ:6:2
│
6│ m.push()
│ ^
help: error occurred in this call of function `mycall`
┌─ call.typ:9:1
│
9│ #mycall()
│ ^^^^^^^^
My feeling is that for some reason it interprets m as being a global array which thus cannot be modified from the function.
Changing the function name to any other name (e.g. add) works like a charm. I was wondering if this is supposed to be normal or if I should post a bug report.
Thanks for you help.