[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Issue: DECLARE-TYPE-FREE (Version 9)

The example I keep coming back to is one where it isn't so much that the
local declaration is easy to enforce as it is where it is difficult *not*
to enforce it.

Suppose I have
(defun frob (delta)
 (flet ((more (x) (+ x delta)))
	;; if you like, put (declare (inline more)) here
   (typecase delta
	(float (locally (declare (type float delta))
		... (more rho ) ... )

       ((signed-byte 8)
		(locally (declare (type (signed-byte 8) delta))
		... (more zz) ... )


Even without the inline, it is a common & legal transformation to do inline
substitution on "small" fletted functions. Even though the reference
"delta" in the definition of more isn't  within the lexical scope of the
local declaration, it *is* the same delta. While its not impossible to
maintain a separate contour in order to segregate the type declarations, it
seems like unnecessary work, and in fact, the declaration is quite useful
if "more" is inlined.