[cffi-devel] Using `define-foreign-type' as defclass

Diogo F. S. Ramos diogofsr at gmail.com
Mon Aug 27 09:04:36 UTC 2012


The manual says that `define-foreign-type' is "a thin wrapper macro
around defclass."

Knowing that, I've been using it as a way to define new classes, like
`easy-handle' at section 4.11, but instead of creating a new class and
naming a slot `pointer', I'm doing something like:

(define-foreign-type easy-handle (a-parent-foreign-type/class)
  ((pointer :initform (curl-easy-init)))
  (:actual-type :pointer)
  (:simple-parser easy-handle))

It works, be as the manual separate these things, I wonder: Am I using
it wrong?




More information about the cffi-devel mailing list