How to convince Lisp SBCL to do inline fixnum arithmetic?
问题 I've found some techniques in other SO answers, but apparently I've been unable to convince SBCL to do inline fixnum arithmetic: (declaim (optimize (speed 2) (safety 1))) (declaim (ftype (function (fixnum fixnum) double-float) fixnumtest) (inline fixnumtest)) (defun fixnumtest (i j) (declare (type fixnum i j)) (let* ((n (the fixnum (+ i j))) (n+1 (the fixnum (1+ n)))) (declare (type fixnum n n+1)) (/ 1.0d0 (the fixnum (* n n+1)) ) ) ) (defun main () (format t "~11,9F~%" (fixnumtest 2 3)) )