diff options
author | Hugo Hörnquist <hugo@lysator.liu.se> | 2023-09-13 00:01:28 +0200 |
---|---|---|
committer | Hugo Hörnquist <hugo@lysator.liu.se> | 2023-09-13 00:01:28 +0200 |
commit | a82b6c772089aa46e30c6c89ef48f514294df3cb (patch) | |
tree | e25d9b6fd1fefe8b6ac293a5c0b53293872a8f54 /doc/ref/general/util-exceptions.texi | |
parent | Add basic documentation for lens. (diff) | |
parent | Even more documentation. (diff) | |
download | calp-a82b6c772089aa46e30c6c89ef48f514294df3cb.tar.gz calp-a82b6c772089aa46e30c6c89ef48f514294df3cb.tar.xz |
Merge branch 'next' into datarewrite-structures
Diffstat (limited to 'doc/ref/general/util-exceptions.texi')
-rw-r--r-- | doc/ref/general/util-exceptions.texi | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/doc/ref/general/util-exceptions.texi b/doc/ref/general/util-exceptions.texi new file mode 100644 index 00000000..34ba33f9 --- /dev/null +++ b/doc/ref/general/util-exceptions.texi @@ -0,0 +1,40 @@ +@node Exception & Warning Utilities +@section Exception & Warning Utilities +@anchor{warning} + +Warnings are like exceptions, but only fatal when wanted. + +@code{(hnh util exceptions)} + +@defun warning fmt args ... +Emit a warning. + +If the parameter @var{warnings-are-errors} is true, then an exception +of type @code{'warning} will be raised, with @var{fmt} and @var{args} +as arguments. + +If that parameter is false, then the procedure in +@var{warning-handler} will instead be called. +@end defun + +@deftp {parameter} warning-handler +Parameter containing proceudre which will be called for non-throwing +warnings. This procedure is assumed by the program to log the warning +in some way, and continue program flow. But anything goes. + +The procedure is given a format specifier (as per Scheme's basic +@code{format}), along with the correct number of arguments. +@end deftp + +@deftp {parameter} warnings-are-errors +Boolean parameter, which if set causes warnings to be thrown as exceptions. +@end deftp + +@defun fatal fmt args ... +Display the message in fmt, populated with args, then raises the UNIX +signal SIGINT, which kills the program. +@end defun + +@defun filter-stack pred? stack +@c TODO document me +@end defun |