[Openmcl-devel] Undefined function: muting the compiler
Alexander Repenning
ralex at cs.colorado.edu
Wed Nov 24 13:16:13 PST 2010
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:
;Compiler warnings :
; In (BLO (T)) inside an anonymous lambda form: Undefined function (SETF BLI)
This simple minded variant does not work either:
(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
More information about the Openmcl-devel
mailing list