Closed kiselgra closed 6 years ago
Currently I do this:
(comment "throw" :prefix "") (runtime-error ...)
I'm not sure about the handlers, but I think adding throw would be easy and (even alone) has the benefit of GCC's runtime catching it and printing the exception's text before aborting the program.
I think I would prefer the latter, i.e., catchting
, oder with-exception-handler
or something like that.
We chose the syntax
(catching (((T1 name) handler-code1)
((T2 name) handler-code2))
body)
that generates
try {
body
}
catch (T1 name) {
handler-code1
}
catch (T2 name) {
handler-code2
}
Addendum: catch-all works via (t ...)
(catching (((T1 name) handler-code1)
((T2 name) handler-code2))
(t handler-code3))
body)
that generates
try {
body
}
catch (T1 name) {
handler-code1
}
catch (T2 name) {
handler-code2
}
catch (...) {
handler-code3
}
We are missing those :)
or like this?
or with a different name?
We could also have the first one built-in and the second one as user-space macro...
@lispbub Any preferences?