[UFFI-Users] def-[foreign-]type in clsql/uffi: to quote or not to quote

Kevin Rosenberg kevin at rosenberg.net
Thu Sep 9 22:14:14 MDT 2004


Hoehle, Joerg-Cyril wrote:

> Grepping through the CLSQL source code (I just downloaded 3.0.3 to
> be sure not to talk about ancient stuff), and scanning the UFFI
> documentation, it appears that there's huge confusion about types that
> need quoting or not.

Agreed. In fact, what happens is that the function
uffi:convert-from-foreign-type will ignore the quote character. The
relevant code from primitives.lisp is: 
  (case sub-type
    (cl:quote
      (convert-from-uffi-type (cadr type) context))

> db-oracle/oracle-sql.lisp:344:(uffi:def-type double-pointer '(* :double))
> db-oracle/oracle-sql.lisp:589:(uffi:def-type byte-pointer (* :byte))
> I.e. within one file, the type is sometimes quoted, sometimes not.
> There are many other inconsistent uses of def-[foreign]-type.

As convert-from-uffi-type justs strips the quotes away, they ought not
be in the code.

> Sadly, it looks like the UFFI implementation gets along with both forms -- otherwise clsql shouldn't pass the tests, should it?!?
> I do not consider this confusion a feature. It just makes porting harder.

Agreed, it is not a feature. I'll clean up the CLSQL code and UFFI
documentation.

-- 
Kevin Rosenberg
kevin at rosenberg.net


More information about the UFFI-Users mailing list