[cffi-devel] Lisp type for word size

Tobias C Rittweiler tcr at freebits.de
Mon Oct 25 15:41:09 UTC 2010


In article <tcr-C05AC2.17212025102010 at news.gmane.org>,
 Tobias C Rittweiler <tcr at freebits.de> wrote:

> Does CFFI contain a Lisp type which represents the
> machine's word size?
> 
> I guess it could be defined as
> 
>   (deftype word-size ()
>     `(unsigned-byte ,(* 8 (foreign-type-size :long))))
> 
> Are there any caveats? E.g. what about a 32bit Lisp
> implementation on a 64bit architecture?
> 
> Perhaps the type should rather be defined in each
> backend.

Clarification:

I'm concerned about the 32bit Lisp on 64bit architecture
issue, because for my purposes I'd like 

  (make-pointer (the word-size X))

never signal a type error.

  -T.





More information about the cffi-devel mailing list