Ticket #998 (new defect)

Opened 2 years ago

weird behavior of (read-line)

Reported by: hyh1048576 Owned by:
Priority: normal Milestone:
Component: IDE Version: 1.8
Keywords: Cc:


e.g. when I do the following loop, it only read two lines. (Lispworks and CLisp read 3 lines)

(loop for i from 1 to 3 do (read-line)) 1 2 2 3 NIL

and the following code only reports error in Clozure (in CLisp and Lispworks it is fine):

? (defun take-input(n) (let ((s ()))

(dotimes (i n)


(with-input-from-string (s (read-line)) (loop for x = (read s nil :end) until (eq x :end) collect x)) s))

s)) ? (take-input 1) 1 2

Error: Reader error on #<STRING-INPUT-STREAM #x302006AA204D>, near position 1, within ")":

Unmatched ')' .

Note: See TracTickets for help on using tickets.