guile-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Guile-commits] 02/07: Move false-if-exception down in boot-9


From: Andy Wingo
Subject: [Guile-commits] 02/07: Move false-if-exception down in boot-9
Date: Fri, 8 Nov 2019 09:31:53 -0500 (EST)

wingo pushed a commit to branch wip-exceptions
in repository guile.

commit f9b594c482f78dace86a1039f2955296ed538da3
Author: Andy Wingo <address@hidden>
Date:   Thu Nov 7 15:07:14 2019 +0100

    Move false-if-exception down in boot-9
    
    * module/ice-9/boot-9.scm (false-if-exception): Move down.
---
 module/ice-9/boot-9.scm | 47 +++++++++++++++++++++++++++--------------------
 1 file changed, 27 insertions(+), 20 deletions(-)

diff --git a/module/ice-9/boot-9.scm b/module/ice-9/boot-9.scm
index 3b98aaf..c32a307 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}



reply via email to

[Prev in Thread] Current Thread [Next in Thread]