You used pub, which seems to imply that you intend to declare terms in the global scope. This makes me uneasy because if it is being set as a variable, it suggests that you intend to use a global variable, which is generally an unnecessary anti-pattern.
It could be an anti pattern. The idea is - when the program is in its ‘normal’ state - use the const arrays (in a lot of places). When I run (just recompile) the program locally I have to change / tune these arrays, write the source code to some file, and replace the default_terms with the newly generated ones.
yes, zig will only include things that are actually needed, most languages remove them after the fact, but that tends to mis things
zig doesn’t look at them in the first place, but that’s also the downside, if it isn’t needed your code won’t trigger any errors beyond syntax errors. Its called lazy evaluation.
Great. That is very usable.
One extra question. Is it possible to print the whole thing exactly as it is declared in code?
Or do I need to write a function for that?
(Edit: in reality the struct is much bigger of course. and not filled with ints but small structs)