Evaluating the following form hangs SBCL (with high CPU load):
(defun euler-1 ()
(labels ((sum-d (n)
(let ((m (truncate 999 n)))
(/ (* n m (1+ m)) 2))))
(- (+ (sum-d 3)
Perhaps, the hang isn't infinite. Evaluating the following (different)
form hangs temporarily (but still noticeably):
(defun foo ()
(labels ((bar (n)
(* n (1+ n) (1- n))))
(+ (bar 3)
Some other info:
* Using flet results in the same problem.
* Using a separate function (instead of flet or labels) does not hang.
* The hang depends on the actual constants. For instance, replacing 15
with 6 above eliminates the hang.
SBCL 220.127.116.11 AMD64 Ubuntu 8.10.