You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 15, 2023. It is now read-only.
Not everything needs to be wrapped, for example math objects are ok. Fields with naming like xCount need to be write protected. However object like Mesh hold collections that need to be wrapped in order to implement range checks for example.
First one is easy, remove export marker and write procs, as explained in the manual:
procglyphCount*(x: Front): int32= x.glyphCount
My solution for the last one is to return hidden pointers (this has the cost of introducing temporaries) and define array access operators on distinct types, one for each field:
Tested and it works. Pros: Accidentally creating a copy: let x = x.maps is prevented by the compiler (no =copy defined for distincts), also the syntax remains the same. Cons: temporary pointer variables are introduced by the C back end.
Not everything needs to be wrapped, for example math objects are ok. Fields with naming like xCount need to be write protected. However object like
Meshhold collections that need to be wrapped in order to implement range checks for example.First one is easy, remove export marker and write procs, as explained in the manual:
My solution for the last one is to return hidden pointers (this has the cost of introducing temporaries) and define array access operators on distinct types, one for each field:
Tested and it works. Pros: Accidentally creating a copy:
let x = x.mapsis prevented by the compiler (no=copydefined for distincts), also the syntax remains the same. Cons: temporary pointer variables are introduced by the C back end.