Fix ERROR:ILLEGAL-STREAM-ELEMENT in runtime/stream.scm.
authorTaylor R Campbell <campbell@mumble.net>
Wed, 9 Dec 2009 17:43:44 +0000 (12:43 -0500)
committerTaylor R Campbell <campbell@mumble.net>
Wed, 9 Dec 2009 17:43:44 +0000 (12:43 -0500)
The first argument to what CONDITION-CONSTRUCTOR returns must be a
continuation, so (ERROR (MAKE-ILLEGAL-STREAM-ELEMENT ...)) doesn't
work.  Instead use CONDITION-SIGNALLER.

src/runtime/stream.scm

index a99023fbafff964f0cbac29e400f42646d240452..066e59cf036c7172cbeecb396103ebe1d45f13bb 100644 (file)
@@ -296,11 +296,8 @@ USA.
     (reset-primes!)
     (add-secondary-gc-daemon! reset-primes!)))
 
-(define (error:illegal-stream-element stream operator operand)
-  (error (make-illegal-stream-element "stream" stream operator operand)))
-
-(define make-illegal-stream-element)
 (define condition-type:illegal-stream-element)
+(define error:illegal-stream-element)
 
 (define (initialize-conditions!)
   (set! condition-type:illegal-stream-element
@@ -310,14 +307,18 @@ USA.
          (lambda (condition port)
            (write-string "The object " port)
            (write (access-condition condition 'DATUM) port)
-           (write-string ", occurring in the " port)
+           (write-string ", passed as the " port)
            (write-string (ordinal-number-string
                           (+ (access-condition condition 'OPERAND) 1))
                          port)
            (write-string " argument to " port)
            (write-operator (access-condition condition 'OPERATOR) port)
            (write-string ", is not a stream." port))))
-  (set! make-illegal-stream-element
-       (condition-constructor condition-type:illegal-stream-element
-                              '(TYPE DATUM OPERATOR OPERAND)))
+  (set! error:illegal-stream-element
+       (let ((signaller
+              (condition-signaller condition-type:illegal-stream-element
+                                   '(TYPE DATUM OPERATOR OPERAND)
+                                   standard-error-handler)))
+         (named-lambda (error:illegal-stream-element stream operator operand)
+           (signaller "stream" stream operator operand))))
   unspecific)
\ No newline at end of file