AW: [UFFI-Users] get-slot-value and nested structures
Joerg-Cyril.Hoehle at t-systems.com
Mon Sep 6 03:20:57 MDT 2004
Marco Baringer wrote:
>along the same lines: when don't you know (at compile time) the type
>of what you're accessing?
Consider dynamically invoking functions you never heard about previously. RMI/CORBA etc. all must do this.
Your model would need to invoke (COMPILE NIL `(lambda #)), where all that is needed is a desription of how to (un)marshall the arguments and invoke the function. CLISP's FFI does just this. CMUCL has alien-funcall, whose description is IIRC evaluated.
Of course, (COMPILE #) may lead to more efficient invocation of the foreign function -- when using native code -- or atleast, to better integration with 32bit integers. It's maybe like the difference between dynamic and non-dynamic CORBA, which I've heard plenty of times is much more efficient (but I have no first-hand experience in this area).
>does clisp actually use the type information?
I believe you may be confusing Lisp object types with C types. (DECLARE (TYPE ...)) has always been ignored in compiled CLISP.
But CLISP strictly follows the FFI C type descriptions. Otherwise it could not interface. :-)
(c-array uint8 1) is very different from (c-array uint16 1).
More information about the UFFI-Users