Re: Idea/proposal/question DEF-FOREIGN-VAR

Edi Weitz <[email protected]> 14 Aug 2003 22:47:51 +0200
Newsgroups gmane.lisp.uffi.general
Message-ID <[email protected]>
On Thu, 14 Aug 2003 14:37:14 -0600, Kevin Rosenberg <kevin-HJRc7zDS/[email protected]> wrote:

> Good find! ff:def-foreign-variable is not listed on the
> foreign-types.htm manual page. However, it is documented separatedly
> at
> http://www.franz.com/support/documentation/6.2/doc/pages/operators/ff/def-foreign-variable.htm
> 
> You should be able to use the :type keyword for non-integer types,
> but I haven't tested this function.

Unfortunately not. I wasn't clear about that: I had already found and
read the docs for this function (although not the whole AllegroCL FFI
docs, I have to admit) and I already played with the :TYPE
keyword. However, this doesn't seem to be the right way.

  "TYPE is the access type of the variable, and can be any of the
   valid access types for MEMREF and MEMREF-INT. The default access
   type is :UNSIGNED-LONG."

The valid access types for MEMREF are rather obscure things like
:NYBBLE or :UNSIGNED-NATURAL. In most other cases you'll get an error
like

  Error: Illegal type to memref: :INT
    [condition type: SIMPLE-ERROR]

:(

Edi.