planetis-m / naylib

Yet another raylib Nim wrapper
MIT License
181 stars 10 forks source link

Procs with clear side effects are treated as funcs. #105

Closed lilkeet closed 2 months ago

lilkeet commented 2 months ago

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.

lilkeet commented 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.