mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-08 22:50:27 +02:00
error in terms of case-lambda
* module/ice-9/boot-9.scm (error): Redefine using case-lambda.
This commit is contained in:
parent
010b159f56
commit
4eeaf67c8c
1 changed files with 9 additions and 10 deletions
|
@ -845,16 +845,15 @@ If there is no handler at all, Guile prints an error and then exits."
|
||||||
;;; {Error Handling}
|
;;; {Error Handling}
|
||||||
;;;
|
;;;
|
||||||
|
|
||||||
(define (error . args)
|
(define error
|
||||||
(save-stack)
|
(case-lambda
|
||||||
(if (null? args)
|
(()
|
||||||
(scm-error 'misc-error #f "?" #f #f)
|
(save-stack)
|
||||||
(let loop ((msg "~A")
|
(scm-error 'misc-error #f "?" #f #f))
|
||||||
(rest (cdr args)))
|
((message . args)
|
||||||
(if (not (null? rest))
|
(save-stack)
|
||||||
(loop (string-append msg " ~S")
|
(let ((msg (string-join (cons "~A" (make-list (length args) "~S")))))
|
||||||
(cdr rest))
|
(scm-error 'misc-error #f msg (cons message args) #f)))))
|
||||||
(scm-error 'misc-error #f msg args #f)))))
|
|
||||||
|
|
||||||
;; bad-throw is the hook that is called upon a throw to a an unhandled
|
;; bad-throw is the hook that is called upon a throw to a an unhandled
|
||||||
;; key (unless the throw has four arguments, in which case
|
;; key (unless the throw has four arguments, in which case
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue