Hi!
Compile the following code:
---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<
(defun foo (xyz)
(with-open-file (f "something"
:if-does-not-exist xyz)
(unless f (return-from foo 42))
(read-line f)))
---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<
And the compiler (CMUCL 19a, x86, Linux 2.6) will say:
;
;
; File: /home/stesch/lisp/python-unreachable.lisp
; In: DEFUN FOO
; (RETURN-FROM FOO 42)
; Note: Deleting unreachable code.
;
; Compilation unit finished.
; 1 note
It doesn't know that XYZ can be NIL and therefor the stream F can be
NIL, too. The code isn't deleted when I write ":if-does-not-exist
nil".
Regards,
Stefan
--
Web: http://www.no-spoon.de/ -*- IRC: stesch @ freenode