Closed lilkeet closed 2 months ago
although https://github.com/planetis-m/naylib/commit/d4981f1612d5571b76714a2234287b9e0a7cff15 adds the func labels, all the procs not labled func are still assumed to be funcs. hopefully this issue gets a permanent + neat solution when c2nim is used for codegen (https://github.com/planetis-m/naylib/pull/106#issuecomment-2042321701), but the issue is still present. I will do a quick look over of the current code generator module and see if I can mod it for a quick fix.
The procs imported from c that have side effects need to be marked with the pragma "sideEffect". Otherwise, IO and other scary things can be done from inside a func.
I don't think Nim does anything smart enough with the effect system that this should affect much. But it is annoying.