diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2017-01-26 19:20:23 -0800 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2017-01-26 19:20:23 -0800 |
commit | 466f2a5842b131b0d94b9a97e78da709920a2c06 (patch) | |
tree | 43ad9b1b34f3ef22df692815277d635fc5e24eee /txr.1 | |
parent | d11b2dce1ea83bd396a275d42096631a7976ea29 (diff) | |
download | txr-466f2a5842b131b0d94b9a97e78da709920a2c06.tar.gz txr-466f2a5842b131b0d94b9a97e78da709920a2c06.tar.bz2 txr-466f2a5842b131b0d94b9a97e78da709920a2c06.zip |
Expose defer-warning and dump-deferred-warnings.
* unwind.c (uw_late_init): Register defer-warning and
dump-deferred-warnings intrinsics.
* txr.1: Documented.
Diffstat (limited to 'txr.1')
-rw-r--r-- | txr.1 | 53 |
1 files changed, 53 insertions, 0 deletions
@@ -34145,6 +34145,59 @@ has been registered via and not yet purged by .codn purge-deferred-warning . +.coNP Function @ defer-warning +.synb +.mets (defer-warning << args ) +.syne +.desc +The +.code defer-warning +function attempts to register a deferred warning. The +.meta args +argument corresponds to the arguments which are passed to the +.code throw +function in order to generate a warning exception, not including the exception +symbol. + +Args is expected to have at least two elements, the second of which +is a deferred warning tag. + +The +.code defer-warning +function returns +.codn nil . + +Note: this functions is intended for use in exception handlers. The +following example shows a handler which intercepts warnings. It defers +deferrable warnings, and prints ordinary warnings: + +.cblk + (handle + (some-form ..) ;; some code which might generate warnings + (warning (msg . args) + (if (car args) + (defer-warning (cons msg args)) ;; tag present: defer + (put-line `warning: @msg`)) ;; print immediately + (throw 'continue))) ;; warning processed: resume execution +.cble + +.coNP Function @ dump-deferred-warnings +.synb +.mets (dump-deferred-warning << stream ) +.syne +.desc +The +.code dump-deferred-warnings +converts the list of pending warnings into diagnostic messages +sent to +.metn stream . +After the diagnostics are issued, the list of pending warnings +is cleared. + +Note: there is normally no need for user programs to use this +function since deferred warnings are printed in various necessary +circumstances. + .SS* Delimited Continuations \*(TL supports delimited continuations, which are integrated with the |