diff options
author | Andy Wingo <wingo@pobox.com> | 2019-11-07 15:07:14 +0100 |
---|---|---|
committer | Andy Wingo <wingo@pobox.com> | 2019-11-07 15:07:14 +0100 |
commit | f9b594c482f78dace86a1039f2955296ed538da3 (patch) | |
tree | 4b221d4f88ee766a68aa7f41d4f6213d47e3db08 | |
parent | 9835ed1809f774233bd9962273f1d6fc07314671 (diff) | |
download | guile-f9b594c482f78dace86a1039f2955296ed538da3.tar.gz |
Move false-if-exception down in boot-9
* module/ice-9/boot-9.scm (false-if-exception): Move down.
-rw-r--r-- | module/ice-9/boot-9.scm | 47 |
1 files changed, 27 insertions, 20 deletions
diff --git a/module/ice-9/boot-9.scm b/module/ice-9/boot-9.scm index 3b98aaf75..c32a307db 100644 --- a/module/ice-9/boot-9.scm +++ b/module/ice-9/boot-9.scm @@ -1067,26 +1067,6 @@ VALUE." (define call/cc call-with-current-continuation) -(define-syntax false-if-exception - (syntax-rules () - ((false-if-exception expr) - (catch #t - (lambda () expr) - (lambda args #f))) - ((false-if-exception expr #:warning template arg ...) - (catch #t - (lambda () expr) - (lambda (key . args) - (for-each (lambda (s) - (if (not (string-null? s)) - (format (current-warning-port) ";;; ~a\n" s))) - (string-split - (call-with-output-string - (lambda (port) - (format port template arg ...) - (print-exception port #f key args))) - #\newline)) - #f))))) @@ -1843,6 +1823,33 @@ written into the port is returned." file-name-separator-string) file))) + + + +;;; {Exception-handling helpers} + +(define-syntax false-if-exception + (syntax-rules () + ((false-if-exception expr) + (catch #t + (lambda () expr) + (lambda args #f))) + ((false-if-exception expr #:warning template arg ...) + (catch #t + (lambda () expr) + (lambda (key . args) + (for-each (lambda (s) + (if (not (string-null? s)) + (format (current-warning-port) ";;; ~a\n" s))) + (string-split + (call-with-output-string + (lambda (port) + (format port template arg ...) + (print-exception port #f key args))) + #\newline)) + #f))))) + + ;;; {Help for scm_shell} |