Jim Newton
10/19/2015 11:41:00 AM
[BTW, ISO=in search of, not international standard organization]
Can someone help me understand what the issue is with my program?
I also posted on the sbcl developers list, but was hoping someone
on comp.lang.lisp might be able to suggest something as well.
I get an SBCL compiler note that unreadable code is being deleted.
-+ note (2)
|-- deleting unreachable code
`-- deleting unreachable code
The offending line is a call to SET-EXCLUSIVE-OR, which is being used as a test in a COND.
The the text of the function is pretty large, but here is what I think is the interesting part.
(let ((current-states (ndfa:get-initial-states ndfa)))
(loop :while t
:do (let* ((next-char (read-next-char))
(next-states (perform-some-transitions ndfa current-states (list next-char))))
(cond
((null next-states)
(error "states exhausted unexpectedly"))
((find-if #'state-final-p next-states)
(consume (best-label current-states))
(return-from parse-file-content nil))
((set-exclusive-or next-states current-states) ;; <<-- CURIOUS COMPILER NOTE
(consume (best-label current-states)))
(t ; state did not change, keep reading
nil))
(setf buf (tconc buf next-char))
(setf current-states next-states))))))))
I'll attach the file being compiled, zipf.lisp, in case anyone wants to try to reproduce it.
You'll also need another file, ndfa.lisp which is required by the DEFPACKAGE.
The note is associated with line 128 of file zipf.lisp.
Thanks in advance for advise anyone can give me.