9 ms·
`scope()` means that it only executes `exit` once the block goes out of scope, but what's afterwards is still "executed" before it? The website docs seem prett
by hnedeotes 5y ago
`scope()` means that it only executes `exit` once the block goes out of scope, but what's afterwards is still "executed" before it?
The website docs seem pretty nice and comprehensive (as in with enough technical details but also examples), and I like the idea of having some higher-level constructs while being able to go full lower.
If I wanted to use a C lib I would need to wrap it right? I can't just use it directly?
- destructionator 5y agoNot wrap per se, but bind. The parts of the .h file you need needs to be translated to D. There's no runtime cost to this and the function works the same as in C which is why I don't like calling it a wrapper. But doing this is easy, sometimes literal copy/paste, often copy/paste with simple adjustments. There's various automated options that can do 95% of the work too.
- hnedeotes 5y agoAh, so basically you just have to create somehow a header file that D can use? I've looked into the `deimos` repos and there's a bunch of them, what I see is, C header files in a folder, then a folder with one or several d files (not .di), that set up somethings and have a extern (C) { ... } block declaring types and funcs from the C header file. Then when building you just link the original required C libs? It seems nice.