From: Harald Hanche-O. <ha...@ma...> - 2005-07-09 15:36:05
|
Compiling this form: (compile nil (lambda (stream) (read-byte stream nil))) produces this spurious note: ; in: lambda nil ; (READ-BYTE STREAM NIL) ; --> BLOCK LET IF LET IF SB-IMPL::EOF-OR-LOSE IF ERROR ; ==> ; STREAM ; ; note: deleting unreachable code It appears that the following code will cure the simple case where eof-error-p is a literal nil: (define-compiler-macro eof-or-lose (&whole form stream eof-error-p eof-value) (declare (ignore stream eof-value)) (if eof-error-p form nil)) But it doesn't help against a non-nil form that the compiler can prove is nil, such as (not t), so this is presumably not the right solution. (Also, it seems that compiler macros are hardly used in the SBCL source, so presumably, other mechanisms are used instead.) - Harald |