I cannot compile the following:
(defun foo ()
(labels ((bar () (bar))
(baz () (bar)))
(baz)))
* (compile 'foo)
Compiling LAMBDA NIL:
In: LAMBDA NIL
(LABELS ((BAR #
#)
(BAZ #
#))
(BAZ))
Note: Deleting unreachable code.
Error in function COMMON-LISP::ASSERT-ERROR:
The assertion (EQ (C::LAMBDA-TAIL-SET C::CALLER)
(C::LAMBDA-TAIL-SET (C::LAMBDA-HOME C::CALLEE))) failed.
Restarts:
0: [CONTINUE] Retry assertion.
1: [ABORT ] Return to Top-Level.
Debug (type H for help)
(COMMON-LISP::ASSERT-ERROR
(EQ (C::LAMBDA-TAIL-SET C::CALLER) (C::LAMBDA-TAIL-SET #))
NIL
NIL)
Source: Error finding source:
Error in function DEBUG::GET-FILE-TOP-LEVEL-FORM: Source file no longer exists:
target:code/macros.lisp.
0]
The above FOO was the smallest test case I could find for this
behavior. FOO has an endless loop, but the original code terminated.
This is the original function:
(defun split-line (str)
(let ((len (length str)))
(labels ((shift (lag head)
(cond ((= head len) (list (subseq str lag head)))
((eq #\space (char str head))
(cons (subseq str lag head) (skip (1+ head))))
(t (shift lag (1+ head)))))
(skip (head)
(cond ((= head len) '())
((eq #\space (char str head))
(skip (1+ head)))
(t (shift head (1+ head))))))
(skip 0))))