Is there a way to define a 'module' variable?

I’ll leave the why to someone else but this is what you need to do:

module Tofu
       counter = 0
       f() = (global counter += 1; counter)
       export f
end
4 Likes