summaryrefslogtreecommitdiffstats
path: root/txr.1
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2020-05-18 13:40:22 -0700
committerKaz Kylheku <kaz@kylheku.com>2020-05-18 13:40:22 -0700
commit097e361d229a12ab7a8e1cddcfb589c8db62388b (patch)
treecfc134779a9221504d2f1927051a4e1ef6e61bc5 /txr.1
parent5db470c24ed43f84ab6915b8f6eea3e53a709f1f (diff)
downloadtxr-097e361d229a12ab7a8e1cddcfb589c8db62388b.tar.gz
txr-097e361d229a12ab7a8e1cddcfb589c8db62388b.tar.bz2
txr-097e361d229a12ab7a8e1cddcfb589c8db62388b.zip
New assert macro.
* eval.c (rt_assert_fail, me_assert): New static functions. (eval_init): assert macro and sys:rt-assert-fail function registered. * lib.c (func_n4ov): New function. * lib.h (func_n4ov): Declared. * txr.1: Documented.
Diffstat (limited to 'txr.1')
-rw-r--r--txr.135
1 files changed, 35 insertions, 0 deletions
diff --git a/txr.1 b/txr.1
index a1a21800..99c354b2 100644
--- a/txr.1
+++ b/txr.1
@@ -42594,6 +42594,41 @@ The frame receives control even if it it is not otherwise eligible for
catching the exception type denoted by
.metn symbol .
+.coNP Macro @ assert
+.synb
+.mets (assert < expr >> [ format-string << format-arg *])
+.syne
+.desc
+The
+.code assert
+macro evaluates
+.metn expr .
+If
+.meta expr
+yields any true value, then
+.code assert
+terminates normally, and that value is returned.
+
+If instead
+.meta expr
+yields
+.codn nil ,
+then
+.code assert
+throws an exception of type
+.codn assert .
+The exception carries an informative character string that contains
+a diagnostic detailing the expression which yielded
+.codn nil ,
+and the source location of that expression, if available.
+
+If the
+.meta format-string
+and possibly additional format arguments are given to
+.code assert
+then those arguments are used to format additional text which is appended to
+the diagnostic message after a separating character such as a colon.
+
.SS* Static Error Diagnosis
This section describes a number of features related to the diagnosis