Next: System Interrupt Handlers
Up: Events
Previous: User-Defined Events
  Index
System Event Handlers
In the tables above the default event handlers for all the events are
given. Here follows a short description of these handlers.
Some of them only print error massages. Those can easily be redefined
by the user.
Others do more complex things to achieve a certain behaviour of
the ECLiPSe system. If those are redefined by the user, this may have
unexpected results.
Note that the default handler can always be called (even while the active
handler is redefined) by using
error(default(Number), Goal [, Module])
It is therefore not necessary to know the names of the default handlers.
Moreover, most of them are not accessible for the user.
- close_handler/2
-
prevents system stream from being closed.
If an attempt is made to close a stream that a system stream
is redirected to, the system stream is first reset to its standard value.
- autoload_handler/3
-
Load the appropriate library and recall the autoloaded goal.
- compare_handler/3
-
applies arithmetic evaluation to the first two arguments of the goal,
then re-calls the culprit goal with the evaluated arguments.
- compiler_error_handler/2
-
prints error message with relevant line, then fails.
- compiled_file_handler/2
-
prints the message about compiled or dumped file,
possible with size and time indication
- compiler_abort_handler/2
-
prints the error message with the file name.
If it can find out the line number, it is printed as well.
- compiler_warning_handler/2
-
prints error message with relevant line, then succeeds.
- delayed_goals_handler/2
-
prints a list of delayed goals and succeeds.
- dynamic_handler/3
-
retracts all clauses of the predicate that is already dynamic and succeeds.
- eof_handler/2
-
takes the appropriate action for reaching end of file,
depending on the culprit goal, e.g. binding the result to end_of_file
if the goal was read/1.
The handler fails for unknown goals.
- error_exit/0
-
Calls user_exit/0 if it exists globally, else aborts.
- error_handler/2
-
prints the error message and the culprit.
Then it raises the event 157 (error exit) which by default
aborts via exit_block(abort).
- error_handler/3
-
used for errors inside tools.
It is like error_handler/2 but it also prints the module
used by the culprit.
- integer_overflow_handler/2
-
redo an overflowed word-sized-integer arithmetic operation with bignums.
- locked_access_handler/2
-
allows certain goals to be executed in spite of the module lock.
- macro_handler/3
-
prints a warning and redefines a macro.
- make_array_handler/3
-
If the
error number is 42 (redefining an existing array), it prints the warning,
erases the existing array and replaces it by a new one.
Otherwise, it calls the default handler.
- meta_unify/1
-
The default handler for metaterm unification. It wakes the delayed goals.
- sepia_start_break/3
-
prints the message
"Entering break level N".
- sepia_end_break/3
-
prints the message
"Leaving break level N" and resets the
toplevel module in case it was changed inside the break level.
- sepia_banner/2
-
prints its second argument on the
toplevel_output stream, flushes the stream and succeeds.
- message_handler/2
-
prints the error message followed by the second argument onto toplevel_output
and succeeds.
Note that the second argument is not necessarily the culprit goal,
but rather just a string to be printed.
This handler is used for events which are not errors.
- output_error_handler/2
-
closes a related stream if necessary and calls system_error_handler/2.
- parser_error_handler/1
-
prints the faulty input line and the corresponding error message, then fails.
Used when the culprit is not important and when no abort should occur.
- past_eof_handler/2
-
closes the stream that has been read past end of file, then calls
error_handler/2.
- sepia_answer/2
- Issues the yes/no/more answer and prompts for input in the latter case.
- sepia_end/0
- Calls user_end/0, if it exists globally, else does nothing.
- sepia_print_values/3
- Standard ECLiPSe results printing routine, i.e. prints variable bindings
and delayed goals.
- sepia_start/0
-
Calls user_start/0, if it exists globally, else does nothing.
- sepia_toplevel_prompt/2
-
Prints the standard ECLiPSe toplevel prompt.
- system_error_handler/2
-
gets the operating system error number (from errno)
and prints the corresponding
error message.
Then it raises the event 157 (error exit) which by default
aborts via exit_block(abort).
- undef_array_handler/3
-
If the culprit was setval/2 with an atom as first argument, a
global variable of that name is created using make_array/1 and
the culprit is re-called.
Otherwise like error_handler/2.
- undef_dynamic_handler/3
-
when a non-dynamic clause has been asserted, it makes it dynamic
(if possible), then asserts it.
- warning_handler/2
-
prints the error message and the culprit and succeeds.
Next: System Interrupt Handlers
Up: Events
Previous: User-Defined Events
  Index
1999-08-06