Emulating exceptions in C: a case study
1–10 of 28 posts
Re: Emulating exceptions in C: a case study
#2Re: Emulating exceptions in C: a case study
#3This is like an article on how to use a screwdriver as a chisel.
Re: Emulating exceptions in C: a case study
#4This is like an article on how to use a screwdriver as a chisel.
If you need a chisel but only have a screwdriver then advice on how to best use it sounds valuable to me.
Re: Emulating exceptions in C: a case study
#5Re: Emulating exceptions in C: a case study
#6Earlier quoted context omitted.
If you need a chisel but only have a screwdriver then advice on how to best use it sounds valuable to me.
Everybody has access to C++ now. Even on the Arduino. If you need exceptions, go to C++. "longjmp" was a bad idea when it was first invented, and it hasn't improved with age.
Re: Emulating exceptions in C: a case study
#7But that was interesting read non the less, thanks OP.
Re: Emulating exceptions in C: a case study
#8Let me use my favourite tool of intellectual terrorism: Just use monads. Ouch, now we have two problems here. :P
I believe the paper of Wadler makes this most clear. Some time ago, it was a real eye-opener for me:
http://homepages.inf.ed.ac.uk/wadler/papers/essence/essence....
Re: Emulating exceptions in C: a case study
#9Actually, being part of the ISO C standard, they are not platform-specific. Otherwise, just use C++ where destructors take care of cleanup when an exception is thrown.
Re: Emulating exceptions in C: a case study
#10> longjmp() and setjmp() are tricky. They’re obscure, can give rise to subtle bugs, are highly platform-specific, and, if abused, will probably lead to awfully confusing code Actually, being part of the ISO C standard, they are not platform-specific. Otherwise, just use C++ where destructors take care of cleanup when an exception is thrown.