[cffi-devel] defcallback ignores ignorable <g>

Luís Oliveira luismbo at gmail.com
Sun May 14 02:45:45 UTC 2006


On 2006-maj-13, at 23:56, Ken Tilton wrote:
> As the subject suggests, methinks the defcallback macro knows about  
> IGNORE but not IGNORABLE. I use the latter a lot because of debug  
> statements that come and go.

Hmm, we're putting the declarations in the wrong place.

(defcallback foo :int ((a :int) (b :int))
   (declare (ignorable b))
   a)

Macroexpands into something like:

(FOREIGN-FUNCTIONS:DEFUN-FOREIGN-CALLABLE
   CFFI-CALLBACKS::|CFFI::FOO| ((A :INT) (B :INT))
   (DECLARE (:CONVENTION :C))
   (DECLARE (IGNORABLE B))
   (LET ((A (VALUES A)))
     (LET ((B (VALUES B)))
       ;; Allegro will warn here because this new B is unused.
       ;;
       ;; Perhaps the declarations should go here?
       ;; (except for IGNORE declarations and maybe others?)
       (BLOCK FOO A))))

-- 
Luís Oliveira
http://student.dei.uc.pt/~lmoliv/





More information about the cffi-devel mailing list