Ticket #998 (closed defect: worksforme)

Opened 2 years ago

Last modified 3 months ago

weird behavior of (read-line)

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

Description (last modified by rme) (diff)

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)
    (push 
     (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 ')' .
}}}

Change History

comment:1 Changed 3 months ago by rme

  • Description modified (diff)

comment:2 Changed 3 months ago by rme

  • Status changed from new to closed
  • Resolution set to worksforme

This works now in current CCL.

Note: See TracTickets for help on using tickets.