ExLisp.Condition (exlisp v0.1.2)

Copy Markdown

Common Lisp Condition and Restart system for ExLisp. Supports:

  • define-condition, make-condition
  • signal, warn, error, cerror
  • handler-bind, handler-case, ignore-errors
  • restart-bind, restart-case, invoke-restart, find-restart, compute-restarts
  • standard restarts: abort, continue, muffle-warning, store-value, use-value

Summary

Functions

Signals a continuable error with a continue restart.

Returns a list of all active restarts.

Signals a fatal error. If unhandled, invokes debugger or raises.

Finds an active restart by name.

Invokes a restart by name or restart object with optional arguments.

Creates a condition instance.

Returns the name of a restart object.

Executes body_fun with handlers registered. Clauses: [{type, fn cond -> ... end}] no_error_clause: nil or fn result -> ... end

Executes body_fun with restarts registered. Clauses: [%{name: name, fun: (...args -> result), report: report_fun, test: test_fun}]

Signals a condition. Searches active handlers in order.

Issues a warning. Signals condition, prints to stderr if unhandled, and offers muffle-warning.

Functions

abort(condition \\ nil)

cerror(continue_control, datum, args \\ [])

Signals a continuable error with a continue restart.

coerce_to_condition(datum, args, default_type)

compute_restarts(condition \\ nil)

Returns a list of all active restarts.

condition_matches_type?(cond_obj, expected_type)

continue(condition \\ nil)

define_condition(name, parent_types, slots, options \\ [])

Registers a user-defined condition.

error(datum, args \\ [])

Signals a fatal error. If unhandled, invokes debugger or raises.

find_restart(name, condition \\ nil)

Finds an active restart by name.

format_condition(inst)

get_handlers()

get_restarts()

init_condition_hierarchy()

invoke_restart(restart_or_name, args \\ [])

Invokes a restart by name or restart object with optional arguments.

is_condition?(arg1)

make_condition(type_or_obj, initargs \\ [])

Creates a condition instance.

muffle_warning(condition \\ nil)

normalize_name(name)

push_handlers(handlers, fun)

push_restarts(restarts, fun)

restart_name(name)

Returns the name of a restart object.

run_handler_case(body_fun, clauses, no_error_clause \\ nil)

Executes body_fun with handlers registered. Clauses: [{type, fn cond -> ... end}] no_error_clause: nil or fn result -> ... end

run_restart_case(body_fun, clauses)

Executes body_fun with restarts registered. Clauses: [%{name: name, fun: (...args -> result), report: report_fun, test: test_fun}]

signal(datum, args \\ [])

Signals a condition. Searches active handlers in order.

store_value(val, condition \\ nil)

use_value(val, condition \\ nil)

warn(datum, args \\ [])

Issues a warning. Signals condition, prints to stderr if unhandled, and offers muffle-warning.