1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-20 11:40:18 +02:00

* Removed old system to check for exceptions.

This commit is contained in:
Dirk Herrmann 2001-02-28 11:48:18 +00:00
parent 0bfa4a17a6
commit 88f9ab70d0
2 changed files with 5 additions and 30 deletions

View file

@ -1,3 +1,7 @@
2001-02-28 Dirk Herrmann <D.Herrmann@tu-bs.de>
* lib.scm (signals-error?, signals-error?*): Removed.
2001-02-28 Dirk Herrmann <D.Herrmann@tu-bs.de>
* lib.scm: Added comment about new convenience functions/macros

View file

@ -38,10 +38,7 @@
make-log-reporter
full-reporter
user-reporter
format-test-name
;; Noticing whether an error occurs.
signals-error? signals-error?*)
format-test-name)
;;;; If you're using Emacs's Scheme mode:
@ -469,29 +466,3 @@
(apply full-reporter result name args)))
(set! default-reporter full-reporter)
;;;; Detecting whether errors occur
;;; (signals-error? KEY BODY ...)
;;; Evaluate the expressions BODY ... . If any errors occur, return #t;
;;; otherwise, return #f.
;;;
;;; KEY indicates the sort of errors to look for; it can be a symbol,
;;; indicating that only errors with that name should be caught, or
;;; #t, meaning that any kind of error should be caught.
(defmacro signals-error? key-and-body
`(signals-error?* ,(car key-and-body)
(lambda () ,@(cdr key-and-body))))
;;; (signals-error?* KEY THUNK)
;;; Apply THUNK, catching errors. If any errors occur, return #t;
;;; otherwise, return #f.
;;;
;;; KEY indicates the sort of errors to look for; it can be a symbol,
;;; indicating that only errors with that name should be caught, or
;;; #t, meaning that any kind of error should be caught.
(define (signals-error?* key thunk)
(catch key
(lambda () (thunk) #f)
(lambda args #t)))