diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2020-05-18 13:40:22 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2020-05-18 13:40:22 -0700 |
commit | 097e361d229a12ab7a8e1cddcfb589c8db62388b (patch) | |
tree | cfc134779a9221504d2f1927051a4e1ef6e61bc5 /txr.1 | |
parent | 5db470c24ed43f84ab6915b8f6eea3e53a709f1f (diff) | |
download | txr-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.1 | 35 |
1 files changed, 35 insertions, 0 deletions
@@ -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 |