0.6.8.23:
[sbcl.git] / src / pcl / gray-streams-stubs.lisp
1 ;;;; stubs for the Gray streams implementation for SBCL
2
3 ;;;; This software is part of the SBCL system. See the README file for
4 ;;;; more information.
5
6 ;;;; This software is in the public domain and is provided with absolutely no
7 ;;;; warranty. See the COPYING and CREDITS files for more information.
8
9 (in-package "SB!GRAY")
10
11 ;;; The intent here is that when Gray streams support isn't installed
12 ;;; yet, and someone tries to do a stream operation on something
13 ;;; which isn't an ordinary CL:STREAM, and the code tries to fall
14 ;;; through to the Gray stream operation, we signal a type error,
15 ;;; instead of an undefined function error.
16 ;;;
17 ;;; Real Gray stream functions will overwrite these stubs. FIXME: When
18 ;;; and if Gray stream functions become a stable part of the system,
19 ;;; we should just delete all this.
20 (defun %gray-stream-stub (oughtta-be-stream &rest rest)
21   (declare (ignore rest))
22   (error 'simple-type-error
23          :datum oughtta-be-stream
24          :expected-type 'stream
25          :format-control "~@<not a ~S: ~2I~_~S~:>"
26          :format-arguments (list 'stream oughtta-be-stream)))
27
28 (dolist (funname
29          '(stream-advance-to-column
30            stream-clear-input stream-clear-output
31            stream-finish-output stream-force-output
32            stream-fresh-line
33            stream-line-column
34            stream-line-length
35            stream-listen stream-peek-char
36            stream-read-byte
37            stream-read-char stream-read-char-no-hang
38            stream-read-line
39            stream-start-line-p
40            stream-terpri
41            stream-unread-char
42            stream-write-byte stream-write-char
43            stream-write-string))
44   (setf (fdefinition funname) #'%gray-stream-stub))