/[cmucl]/src/code/stream.lisp
ViewVC logotype

Diff of /src/code/stream.lisp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.81 by rtoy, Fri Jul 1 14:54:41 2005 UTC revision 1.82 by rtoy, Fri Nov 11 17:21:57 2005 UTC
# Line 465  Line 465 
465  ;;;                     (this will default to CHAR-VAR)  ;;;                     (this will default to CHAR-VAR)
466  (defmacro generalized-peeking-mechanism (peek-type eof-value char-var  (defmacro generalized-peeking-mechanism (peek-type eof-value char-var
467                                           read-form read-eof unread-form                                           read-form read-eof unread-form
468                                           &optional (skipped-char-form nil)                                           &key (skipped-char-form nil)
469                                                     (eof-detected-form nil))                                                (eof-detected-form nil))
470    `(let ((,char-var ,read-form))    `(let ((,char-var ,read-form))
471      (cond ((eql ,char-var ,read-eof)      (cond ((eql ,char-var ,read-eof)
472             ,(if eof-detected-form             ,(if eof-detected-form
# Line 530  Line 530 
530             (read-char stream eof-errorp :eof)             (read-char stream eof-errorp :eof)
531             :eof             :eof
532             (unread-char char stream)             (unread-char char stream)
533             nil             :skipped-char-form nil
534             (eof-or-lose stream (or eof-errorp recursive-p) eof-value))             :eof-detected-form (eof-or-lose stream (or eof-errorp recursive-p) eof-value))
535            ;; fundamental-stream            ;; fundamental-stream
536            (generalized-peeking-mechanism            (generalized-peeking-mechanism
537             peek-type :eof char             peek-type :eof char
538             (if (null peek-type)             (if (null peek-type)
539                 (stream-peek-char stream)                 (stream-peek-char stream)
540                 (stream-read-char stream))                 (stream-read-char stream))
541               :eof
542             (if (null peek-type)             (if (null peek-type)
543                 ()                 ()
544                 (stream-unread-char stream char))                 (stream-unread-char stream char))
545             ()             :skipped-char-form ()
546             (eof-or-lose stream eof-errorp eof-value))))))             :eof-detected-form (eof-or-lose stream eof-errorp eof-value))))))
547    
548  (defun listen (&optional (stream *standard-input*) (width 1))  (defun listen (&optional (stream *standard-input*) (width 1))
549    "Returns T if a character is available on the given Stream."    "Returns T if a character is available on the given Stream."
# Line 1354  output to Output-stream" Line 1355  output to Output-stream"
1355                (infn)                (infn)
1356                :eof                :eof
1357                (unread-char char in)                (unread-char char in)
1358                (outfn char))))))                :skipped-char-form (outfn char))))))
1359        (:file-length        (:file-length
1360         (error 'type-error :datum stream :expected-type 'file-stream))         (error 'type-error :datum stream :expected-type 'file-stream))
1361        (t        (t

Legend:
Removed from v.1.81  
changed lines
  Added in v.1.82

  ViewVC Help
Powered by ViewVC 1.1.5