[cffi-devel] Re: varargs (again)

James Bielman jamesjb at jamesjb.com
Fri Jan 13 06:51:39 UTC 2006


Luís Oliveira <luismbo at gmail.com> writes:

> Does anyone have an example where some sort of defcfun-varargs could
> actually be useful?

This could be useful for the Objective-C bridge:

;; Just tossing out ideas about syntax here...
(defcfun ("objc_msgSend" send) id
  (object id)
  (method selector)
  &rest)

(send (find-objc-class "NSString") "stringWithUTF8String:"
      (:string :encoding :utf-8) "hi")

I think this could be pretty cool (modulo the arguments *rimshot*
about the portability of calling varargs functions through FFI, of
course..)

James



More information about the cffi-devel mailing list