On Sun, Aug 28, 2011 at 5:42 AM, Liam Healy lnp@healy.washington.dc.us wrote:
Yes, thanks. The subclassing of type names was confusing me. The example makes it clear. I think I will define a macro to make the creation of the translate-*-foreign and free-translated-object methods a little bit easier.
Earlier versions of CFFI's type system dealt with names instead of classes for dispatching on types. Dealing with classes allows us to do subclassing and, more importantly, store info in the type instances. E.g. the string type will come with an encoding attached.
What kind of macro are you thinking of? In the COMPLEX case, do you want to abstract away the need to allocate (and free) the structure object explicitly?