[cffi-devel] bits from a new tutorial

Luís Oliveira luismbo at gmail.com
Thu Dec 22 10:14:38 UTC 2005


On 2005-dec-22, at 07:12, Stephen Compall wrote:
> I am writing a CFFI tutorial, to be integrated into the manual when it
> is done if the maintainers will have it.

Looks great, you write very well!

A few minor notes:

- You suggest UFFI-COMPAT is not complete. Well, it should be  
complete (though likely not bug free). It passes all of the uffi- 
tests and is known to work with (and find bugs in) a couple of UFFI  
libraries.

- (defctype :curl-code :int) -- Hmm, using the keyword namespace for  
user-defined types. I'm not sure if it's a good idea. Some people  
have also suggested that using the keyword namespace for CFFI types  
isn't a good idea either.

- @sc{} looks gorgeous. :D


This tutorial shows the usefulness of foreign-funcall for C functions  
with varargs. Lispworks unfortunately doesn't export this  
functionality. Martin, I wonder if Lispworks will ever export  
something like this or if we could have some clues on how to use  
unexported functionality to implement cffi-sys:%foreign-funcall (and  
eventually cffi-sys:%foreign-funcall-pointer).

-- 
Luís Oliveira
http://student.dei.uc.pt/~lmoliv/
Equipa Portuguesa do Translation Project
http://www.iro.umontreal.ca/translation/registry.cgi?team=pt




More information about the cffi-devel mailing list