mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-14 23:50:19 +02:00
add current-warning-port
* libguile/ports.h: * libguile/ports.c (scm_current_warning_port) (scm_set_current_warning_port): New functions, wrapping the Scheme parameter. * module/ice-9/boot-9.scm (current-warning-port): New parameter, defining a port for warnings.
This commit is contained in:
parent
13dd74c8ea
commit
3972de7675
3 changed files with 41 additions and 0 deletions
|
@ -213,6 +213,8 @@ If there is no handler at all, Guile prints an error and then exits."
|
|||
|
||||
(define pk peek)
|
||||
|
||||
;; Temporary definition; replaced later.
|
||||
(define current-warning-port current-error-port)
|
||||
|
||||
(define (warn . stuff)
|
||||
(with-output-to-port (current-error-port)
|
||||
|
@ -2906,6 +2908,19 @@ module '(ice-9 q) '(make-q q-length))}."
|
|||
...)
|
||||
body body* ...)))))))
|
||||
|
||||
|
||||
;;;
|
||||
;;; Warnings.
|
||||
;;;
|
||||
|
||||
(define current-warning-port
|
||||
(make-parameter (current-error-port)
|
||||
(lambda (x)
|
||||
(if (output-port? x)
|
||||
x
|
||||
(error "expected an output port" x)))))
|
||||
|
||||
|
||||
|
||||
|
||||
;;; {Running Repls}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue