Ok, I can't see it.
Why are these to lines (marked below) unreachable
to the compiler?
I want to use the init and update form for the loop var
to read stuff in from stream.
(defun main ()
(with-open-file (log "my.log" :direction :output :if-exists :append
(format log "Wait for fd 0~%")
(sb-sys:wait-until-fd-usable 0 :input)
(format log "Usable reached.~%")
(let ((stream (sb-sys:make-fd-stream 0 :element-type
'(unsigned-byte 8) :input t :output t :buffering :none))
(buf (make-array 100 :element-type '(unsigned-byte 8))))
(format log "Stream created.~%")
(do ((b (read-byte stream nil 'eof) ; <-- UNREACHABLE
(read-byte stream nil 'eof)) ; <-- UNREACHABLE
(i 0 (1+ i)))
((equal b 'eof))
(format log ">>>>'~2x' " b)
(when (= 0 (mod (1+ i) 8))
(error (c) (format log ">>> Error caught:~%'~a'~%error type:
~a~% " c (type-of c))))))
Deignoration would be very welcome. Perhaps it's
obvious, please kick me.
(sbcl 0.9.14, slime current, Linux)
From: Juho Snellman <jsnell@ik...> - 2006-12-21 02:24:42
"Florian Ebeling" <florian.ebeling@...> writes:
> Ok, I can't see it.
> Why are these to lines (marked below) unreachable
> to the compiler?
> (do ((b (read-byte stream nil 'eof) ; <-- UNREACHABLE
> (read-byte stream nil 'eof)) ; <-- UNREACHABLE
It's a known issue with the heuristic that the compiler uses to
determine which code is uninteresting and which code to show deletion
notes for. Use some other name for the variable instead of STREAM, and
the notes should go away.