[Openmcl-devel] bugs in declaring functions as ignore and ignorable?

Gary Byers gb at clozure.com
Tue Apr 25 19:06:09 PDT 2006


The compiler should accept (FUNCTION (SETF symbol)) in IGNORE as well
as IGNORABLE declarations.

Adding insult to injury, it does nothing to actually track local
function usage (everything's implicitly IGNORABLE) in the cases
where the declaration is handled, and IGNORE declarations not
associated with a binding don't generate warnings if they're
violated (e.g.,

(defun foo (x)
     (print x)
     (locally (declare (ignore x)) (print x))
     x)

doesn't complain about the reference inside the LOCALLY.)

(The spec just says that it'd be "desirable" if a warning was issued in that
case, but it seems clear that warning about a valid declaration is Just
Plain Wrong.)


On Tue, 25 Apr 2006, John Wiseman wrote:

> OpenMCL's handling of ignorable declarations seems to barf on
> "(setf blah)"-style function names.
>
> This is fine:
>
>   (defun cats ()
>     (flet ((secret-dogs () :DOG))
>       (declare (ignorable (function secret-dogs)))
>       1))
>
> But this gives a warning:
>
>   (defun cats ()
>     (flet (((setf secret-dogs) (slobber cat) :DOG))
>       (declare (ignorable (function (setf secret-dogs))))
>       1))
>
>   ;Compiler warnings :
>   ;   Unknown declaration (IGNORABLE #'(SETF SECRET-DOGS)), in CATS.
>
> And I feel less certain about this, but it doesn't look right either:
>
>   (defun cats ()
>     (flet ((secret-dogs () :DOG))
>       (declare (ignore (function secret-dogs)))
>       1))
>
>   ;Compiler warnings :
>   ;   Unknown declaration (IGNORE #'SECRET-DOGS), in CATS.
>
> The context here is, of course, that I've got a macro generating stuff
> like this, and the user may or may not call the functions defined in
> the flet.
>
> I'm using OpenMCL 1.0.
>
>
> Thanks,
> John
>
> _______________________________________________
> Openmcl-devel mailing list
> Openmcl-devel at clozure.com
> http://clozure.com/mailman/listinfo/openmcl-devel
>
>



More information about the Openmcl-devel mailing list