[Openmcl-devel] Undefined function: muting the compiler

Gary Byers gb at clozure.com
Wed Nov 24 13:47:15 PST 2010



On Wed, 24 Nov 2010, Alexander Repenning wrote:

> Last time Gary suggested the use of declare (ftype function as means for a forward declaration:
>
> (declare (ftype function ... works great for most cases when one wants to call a function/method that has not been defined yet
>
> ;; we get a warning here:
>
> (defun bla ()
>  (ble))
>
> ;; but not here: nice!
>
> (defun bla ()
>  (declare (ftype function ble))
>  (ble))
>
>
> ;; BUT what about calling setf functions, e.g., CLOS slot access functions:
>
> (defmethod blo ((self t))
>  (declare (ftype function bli))
>  (setf (bli self) 666))
>
> will still produce a warning:

You've declared that BLI is a function; you haven't said anything at all
about (SETF BLI).

>
> ;Compiler warnings :
> ;   In (BLO (T)) inside an anonymous lambda form: Undefined function (SETF BLI)
>
>
> This simple minded variant does not work either:

It should; it's a bug that it doesn't.

>
> (defmethod blo ((self t))
>  (declare (ftype function (setf bli)))
>  (setf (bli self) 666))
>
>
> Is there any  way to persuade the compiler to avoid warnings?
>
> Alex
>
>
>
>
> _______________________________________________
> Openmcl-devel mailing list
> Openmcl-devel at clozure.com
> http://clozure.com/mailman/listinfo/openmcl-devel
>
>



More information about the Openmcl-devel mailing list