[cffi-devel] plural forms for WITH-FOREIGN-POINTER and in general

Liam Healy lnp at healy.washington.dc.us
Thu Dec 10 00:16:50 UTC 2009


I like the idea of 2; it seems general enough that it belongs in alexandria.

Liam

On Wed, Dec 9, 2009 at 9:10 AM, Tamas K Papp <tkpapp at gmail.com> wrote:
> 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)
>                               , at body))
>           `(progn , at 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 at common-lisp.net
> http://common-lisp.net/cgi-bin/mailman/listinfo/cffi-devel
>




More information about the cffi-devel mailing list