codex-storage / questionable

Elegant optional types for Nim
Other
116 stars 5 forks source link

Handle bind (=?) errors in `without` statements differently #54

Closed markspanbroek closed 8 months ago

markspanbroek commented 8 months ago

Keeps track of the current error variable at compile time, instead of using a pointer to the error variable at runtime.

Employs a trick with an unused type parameter to ensure that invocations of the bindFailed() macro are expanded after captureBindError() is expanded.

Fixes #53

elcritch commented 8 months ago

Oopps I missed this! I'll give it a review now.

markspanbroek commented 8 months ago

Did you get around to reviewing this @elcritch? Would love to hear your opinion on this if you have the time.

elcritch commented 8 months ago

Did you get around to reviewing this @elcritch? Would love to hear your opinion on this if you have the time.

I started reviewing it but got interrupted. I'll review it again now.

elcritch commented 8 months ago

Nice, I like removing the global error variable. I've also run into segfault issues lately with threadvars and clang. This approach might even help performance a bit by localizing the error variable on the stack.