From 3972de7675bf771b403eaef97f0741280649b5ed Mon Sep 17 00:00:00 2001 From: Andy Wingo Date: Tue, 28 Jun 2011 23:24:43 +0200 Subject: 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. --- module/ice-9/boot-9.scm | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'module') 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) @@ -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} -- cgit v1.2.3