mirror of
https://gitlab.com/embeddable-common-lisp/ecl.git
synced 2026-02-20 06:00:23 -08:00
New CLOS-STREAMS feature. Stub methods for CLOS streams.
This commit is contained in:
parent
bb95034589
commit
76de65636c
3 changed files with 67 additions and 1 deletions
|
|
@ -411,6 +411,9 @@ cl_boot(int argc, char **argv)
|
|||
#endif
|
||||
#ifdef ECL_CMU_FORMAT
|
||||
ADD_FEATURE("CMU-FORMAT");
|
||||
#endif
|
||||
#ifdef ECL_CLOS_STREAMS
|
||||
ADD_FEATURE("CLOS-STREAMS");
|
||||
#endif
|
||||
/* This is assumed in all systems */
|
||||
ADD_FEATURE("IEEE-FLOATING-POINT");
|
||||
|
|
|
|||
|
|
@ -18,7 +18,10 @@
|
|||
"src:clos;inspect.lsp"
|
||||
#+cmu-format
|
||||
"src:lsp;pprint.lsp"
|
||||
"src:clos;conditions.lsp"))
|
||||
"src:clos;conditions.lsp"
|
||||
#+clos-streams
|
||||
"src:clos;streams.lsp"
|
||||
))
|
||||
|
||||
#-cross
|
||||
(mapc #'(lambda (x) (load x :verbose nil)) +clos-module-files+)
|
||||
|
|
|
|||
60
src/clos/streams.lsp
Normal file
60
src/clos/streams.lsp
Normal file
|
|
@ -0,0 +1,60 @@
|
|||
;;;; Copyright (c) 2004, Juan Jose Garcia-Ripoll
|
||||
;;;;
|
||||
;;;; This program is free software; you can redistribute it and/or
|
||||
;;;; modify it under the terms of the GNU Library General Public
|
||||
;;;; License as published by the Free Software Foundation; either
|
||||
;;;; version 2 of the License, or (at your option) any later version.
|
||||
;;;;
|
||||
;;;; See file '../Copyright' for full details.
|
||||
;;;; The CLOS IO library.
|
||||
|
||||
(in-package "SI")
|
||||
|
||||
;;;
|
||||
;;; The following methods constitute the whole of the interface that a CLOS
|
||||
;;; class has to offer in order to be accepted by READ, WRITE, CLOSE, etc.
|
||||
;;; Here we provide dummy methods that fail with a TYPE-ERROR, which is the
|
||||
;;; condition type expected by the ANSI standard.
|
||||
;;;
|
||||
|
||||
(defmethod ext::stream-input-p ((stream t))
|
||||
(not-a-clos-stream stream 'ext::stream-input-))
|
||||
|
||||
(defmethod ext::stream-output-p ((stream t))
|
||||
(not-a-clos-stream stream 'ext:stream-output-p))
|
||||
|
||||
(defmethod ext::stream-close ((stream t))
|
||||
(not-a-clos-stream stream 'ext:stream-close))
|
||||
|
||||
(defmethod ext::stream-read-char ((stream t))
|
||||
(not-a-clos-stream stream 'ext:stream-read-char))
|
||||
|
||||
(defmethod ext::stream-unread-char ((stream t) char)
|
||||
(not-a-clos-stream stream 'ext:stream-unread-char))
|
||||
|
||||
(defmethod ext::stream-write-char ((stream t) char)
|
||||
(not-a-clos-stream stream 'ext:stream-write-char))
|
||||
|
||||
(defmethod ext::stream-force-output ((stream t))
|
||||
(not-a-clos-stream stream 'ext:stream-force-output))
|
||||
|
||||
(defmethod ext::stream-clear-input ((stream t))
|
||||
(not-a-clos-stream stream 'ext:stream-clear-input))
|
||||
|
||||
(defmethod ext::stream-clear-output ((stream t))
|
||||
(not-a-clos-stream stream 'ext:stream-clear-output))
|
||||
|
||||
(defmethod ext::stream-listen ((stream t))
|
||||
(not-a-clos-stream stream 'ext:stream-listen))
|
||||
|
||||
(defmethod ext::stream-interactive-p ((stream t))
|
||||
(not-a-clos-stream stream 'ext:stream-interactive-p))
|
||||
|
||||
(defun not-a-clos-stream (object method-name)
|
||||
(declare (ext::c-local))
|
||||
(error 'simple-type-error
|
||||
:datum object
|
||||
:expected-type 'STREAM
|
||||
:format-control
|
||||
"The object ~S~%is neither a common-lisp STREAM nor a CLOS object with method ~A."
|
||||
:format-arguments (list object method-name)))
|
||||
Loading…
Add table
Add a link
Reference in a new issue