Changeset 10374


Ignore:
Timestamp:
Aug 6, 2008, 11:10:32 AM (11 years ago)
Author:
gb
Message:

Split off fixed-arg READ-CHAR-INTERNAL from READ-CHAR.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/lib/streams.lisp

    r6205 r10374  
    5151        (values string nil)))))
    5252
     53(eval-when (:compile-toplevel)
     54  (declaim (inline read-char-internal)))
     55
     56(defun read-char-internal (input-stream eof-error-p eof-value)
     57  (declare (optimize (speed 3) (space 0)))
     58  (check-eof
     59   (if (or (typep input-stream 'basic-stream)
     60           (typep (setq input-stream (designated-input-stream input-stream))
     61                  'basic-stream))
     62     (let* ((ioblock (basic-stream-ioblock input-stream)))
     63       (funcall (ioblock-read-char-function ioblock) ioblock))
     64     (stream-read-char input-stream))
     65   input-stream eof-error-p eof-value))
     66
    5367(defun read-char (&optional input-stream (eof-error-p t) eof-value recursive-p)
    54   (declare (ignore recursive-p)
    55            (optimize (speed 3) (space 0)))
    56   (setq input-stream (designated-input-stream input-stream))
    57   (if (typep input-stream 'basic-stream)
    58     (let* ((ioblock (basic-stream-ioblock input-stream)))
    59       (check-eof
    60        (funcall (ioblock-read-char-function ioblock) ioblock)
    61        input-stream eof-error-p eof-value))
    62     (check-eof (stream-read-char input-stream)
    63                input-stream
    64                eof-error-p
    65                eof-value)))
     68  (declare (ignore recursive-p))
     69  (read-char-internal input-stream eof-error-p eof-value))
    6670
    6771(defun unread-char (char &optional input-stream)
Note: See TracChangeset for help on using the changeset viewer.