3 ms·
Seems like useful feature to have. Is it supposed to be only used for error handling (like exceptions) or can you use it for unconventional control flow, too?
by ajuc 14y ago
Seems like useful feature to have.
Is it supposed to be only used for error handling (like exceptions) or can you use it for unconventional control flow, too?
- masklinn 14y agoYou can use it for unconventional control flows if you wish to. For instance, see [0] which implements dynamically scoped variables on top of conditions. I'm not sure that's overly common, but I'm a smalltalk dilettante [0] http://www.lshift.net/blog/2012/06/27/resumable-exceptions-can-macro-express-delimited-dynamic-variables http://www.lshift.net/blog/2012/06/27/resumable-exceptions-c...
- ken 14y agoDan Weinreb (one of the Multics users who brought the Multics condition system to Lisp) wrote about why "error" is not a great term: http://danweinreb.org/blog/what-conditions-exceptions-are-really-about http://danweinreb.org/blog/what-conditions-exceptions-are-re... Personally, I've not seen it used for arbitrary control flow. If you control the syntax of things inside your block, then macros are probably good enough. If you're passing values outside of your own block, then you probably need continuations. OTOH, Lisp programmers have a tendency to not care what something is "supposed to be used for". Using Lisp at all is said to be "the most intelligent way to misuse a computer". :-)