mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-09 21:40:33 +02:00
Move false-if-exception down in boot-9
* module/ice-9/boot-9.scm (false-if-exception): Move down.
This commit is contained in:
parent
9835ed1809
commit
f9b594c482
1 changed files with 27 additions and 20 deletions
|
@ -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}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue