Hacker News new | past | comments | ask | show | jobs | submit login

Why do you mean by ‘throw exceptions from C’? C has no exceptions.



In 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).


This is what I was referring to, sorry for being unclear. :)


That 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




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: