lispEn 2022-11-17 18:13:33

Condition Handler

One of Lisp's great features is its condition system. It serves a similar purpose to the exception handling systems in Java, Python, and C++ but is more flexible. In fact, its flexibility extends beyond error handling conditions are more general than exceptions in that a condition can represent any occurrence during a program's execution that may be of interest to code at different levels on the call stack. (1)


The macro HANDLER-CASE establishes this kind of condition handler.

 The basic form of a HANDLER-CASE is as follows:

 (handler-case expression


where each error-clause is of the following form:

 (condition-type ([var]) code)


Condition Handler in action

#lisp #handler-case #conditions

También te podría interesar
lisp codeEn 2022-07-13 13:12:00
lispEn 2019-09-17 20:18:42
lispEn 2022-11-01 13:51:41
Common lisp is great because of who it is designed by...
lispmxEn 2017-12-26 12:17:40
lispEn 2022-12-06 15:05:07
In this post we will show the Common Lisp version and implementation you're using, from the REPL.