diff options
author | Andy Wingo <wingo@pobox.com> | 2011-06-28 23:24:43 +0200 |
---|---|---|
committer | Andy Wingo <wingo@pobox.com> | 2011-12-05 18:07:06 +0100 |
commit | 3972de7675bf771b403eaef97f0741280649b5ed (patch) | |
tree | 906a7425fea47c87b6504cc09f1360f2ae1ca289 /module | |
parent | 13dd74c8eae595889df6f570007b5f50b78073ce (diff) |
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.
Diffstat (limited to 'module')
-rw-r--r-- | module/ice-9/boot-9.scm | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/module/ice-9/boot-9.scm b/module/ice-9/boot-9.scm index 47f0ead60..1d25f63df 100644 --- a/module/ice-9/boot-9.scm +++ b/module/ice-9/boot-9.scm @@ -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) @@ -2907,6 +2909,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} ;;; |