? cvs.diff ? mixin.fas ? mixin.fasl ? mixin.lib ? package.fas ? package.fasl ? package.lib ? test.lisp Index: mixin.lisp =================================================================== RCS file: /project/cl-plus-ssl/cvsroot/trivial-gray-streams/mixin.lisp,v retrieving revision 1.5 diff -U8 -r1.5 mixin.lisp --- mixin.lisp 14 Sep 2006 17:45:36 -0000 1.5 +++ mixin.lisp 29 Jun 2008 10:59:21 -0000 @@ -64,18 +64,46 @@ (progn (defmethod ccl:stream-read-vector ((s trivial-gray-stream-mixin) seq start end) (stream-read-sequence s seq start end)) (defmethod ccl:stream-write-vector ((s trivial-gray-stream-mixin) seq start end) (stream-write-sequence s seq start end))) +;; up to version 2.43 there were no +;; stream-read-sequence, stream-write-sequence +;; functions in clisp +#+clisp +(eval-when (:compile-toplevel :load-toplevel :execute) + (when (find-symbol "STREAM-READ-SEQUENCE" "GRAY") + (pushnew :clisp-has-stream-read/write-sequence *features*))) + #+clisp (progn + + #+clisp-has-stream-read/write-sequence + (defmethod gray:stream-read-sequence + (seq (s trivial-gray-stream-mixin) &key start end) + (stream-read-sequence s seq (or start 0) (or end (length seq)))) + + #+clisp-has-stream-read/write-sequence + (defmethod gray:stream-write-sequence + (seq (s trivial-gray-stream-mixin) &key start end) + (stream-write-sequence s seq (or start 0) (or end (length seq)))) + + ;; Even if stream-read/write-sequence are precent in CLISP, + ;; it's better to provide stream-read/write-byte/char-sequence + ;; methods too. + ;; Example: if fundamental-binary-input-stream comes in the + ;; class precedence list of your user-defined stream before + ;; the trivial-gray-steam-mixin, the default CLISP implementation + ;; of the stream-read-sequence will be used and in turn it will + ;; call the stream-read-byte-sequence. + (defmethod gray:stream-read-byte-sequence ((s trivial-gray-stream-mixin) seq &optional start end no-hang interactive) (when no-hang (error "this stream does not support the NO-HANG argument")) (when interactive (error "this stream does not support the INTERACTIVE argument"))