4 ms·
For me, error handling has a major flaw: stack unwinding - extremely annoying thing to happen when the program state took many many hours to achieve. I don't th
by akssri 10y ago
For me, error handling has a major flaw: stack unwinding - extremely annoying thing to happen when the program state took many many hours to achieve. I don't think there is any language other than CL that allows restarts etc. to be defined; slime-repl too is invaluable when debugging.
http://www.gigamonkeys.com/book/beyond-exception-handling-conditions-and-restarts.html http://www.gigamonkeys.com/book/beyond-exception-handling-co...
- chaitanya 10y agoRight! A long time back we came up with a really nice way of validating CSV files using restarts. I wrote a bit about it: http://lisper.in/restarts http://lisper.in/restarts
- akssri 10y agoNeat. I use it for things like linesearch and regularization (in optimization), https://github.com/matlisp/matlisp-optimization/blob/master/src/linesearch.lisp https://github.com/matlisp/matlisp-optimization/blob/master/... As a fellow Indian lisper, are you by any chance using CL for work ? Last I heard, the only big CL shop, cleartrip, moved all their codebase to Ocaml.
- chaitanya 10y agoNah, not using CL for work these days :-( I used to work at Cleartrip a long time back, before they moved off Lisp.
- akssri 10y agoAh, that's too bad :( CL is very very underrated as a language. Any insider info on why cleartrip moved away from Lisp ?
- chaitanya 10y agoSince it happened after I left, I am not privy to the exact reasons for the move. However, I guess they were worried about their Lispers moving away (which to some degree had already happened) and them not being able to find new ones.
- lispm 10y agoNice. One thing you might want to add. From reading you present two ways to deal with restarts: 1) interactive debugger 2) programmatical There is another one: 3) restart dialog The program presents you a list of restarts, for example in a GUI dialog, and the end user can select a restart - without interacting with a debugger. The debugger is just one program, which may display the restarts. That's how one used it in applications on a Lisp Machine. To call a debugger could be an option in the list of restarts. For real real end users, even the call to the debugger might not be available and all they can do is to choose an option from the list of restarts. Symbolics offered something called 'Firewall', which did all it can to hide the underlying Lisp system from the end user - here the end user should not interact with a debugger or Lisp listener. But even in a Lisp listener, if you used the 'Copy File' command you might get a dialog shown with the typical options: abort, try again, use other file, enter debugger, ...
- chaitanya 10y agoNice idea! I will add this suggestion.