Hi,

Two suggestions:

1. Could we have a plural form of WITH-FOREIGN-POINTER (similarly to
WITH-FOREIGN-OBJECTS, WITH-FOREIGN-STRINGS).

2. In my own code, I usually use something like this:

(defmacro with-multiple-bindings (macro)
  "Define a version of `macro' with multiple arguments, given as a
list.  Application of `macro' will be nested.  The new name is the 
plural of the old one (generated using format)."
  (let ((plural (intern (format nil "~aS" macro))))
    `(defmacro ,plural (bindings &body body)
       ,(format nil "Multiple binding version of ~(~a~)." macro)
       (if bindings
           `(,',macro ,(car bindings)
                     (,',plural ,(cdr bindings)
                               ,@body))
           `(progn ,@body)))))

(with-multiple-bindings with-foreign-pointer)

Incorporating something similar would replace the repetitions in the
CFFI code, and make it easier to define plural forms.

Cheers,

Tamas


_______________________________________________
cffi-devel mailing list
cffi-devel@common-lisp.net
http://common-lisp.net/cgi-bin/mailman/listinfo/cffi-devel

Reply via email to