5 ms·
Why do you mean by ‘throw exceptions from C’? C has no exceptions.
by sesm 5y ago
Why do you mean by ‘throw exceptions from C’? C has no exceptions.
- ahungry 5y agoIn libjanet you can use a C call like janet_panic() that'll "panic" and throw an exception/error up in the active Janet runtime (so when something bad/unexpected happens in your C code you are providing an API to from Janet, you'd use this).
- saikyun 5y agoThis is what I was referring to, sorry for being unclear. :)
- swdunlop 5y agoThat is like saying Scheme does not have exceptions, except in C, we have setjmp instead of call/cc. It is technically correct, but there is something more flexible that can be perverted into doing the same thing. https://en.wikipedia.org/wiki/Setjmp.h#Exception_handling https://en.wikipedia.org/wiki/Setjmp.h#Exception_handling