<html><body><div style="color:#000; background-color:#fff; font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:10pt"><div>This is the way I thought you did it but I'm running this and it's not working: <br><br>    (with-foreign-object (float :float)<br>     <br>               (setf float 6)<br>         (type-of float))<br><br>     >(INTEGER 0 4611686018427387903)<br><br>The output says it is an integer<br><br>I tried this:<br><br><br>        (with-foreign-object (float :float)<br>             <br>                    (setf (mem-ref float :float) 4)<br>           
      (type-of (mem-ref float :float)))<br><br>And get this error:<br><br>        Value of #1=#:VALUE4 in<br>          (SB-KERNEL:%SET-SAP-REF-SINGLE FLOAT 0 #1#)<br>        is<br>          4,<br>        not a<br>          SINGLE-FLOAT.<br>           [Condition of type SIMPLE-TYPE-ERROR]<br><br><br>If someone could help me cast in CFFI I would appreciate it.  the word "cast" isn't even in the CFFI documentation.  I just would like to be able to cast anything, from functions to variable into other types. Any maybe if someone skilled in CFFI can tell me if it so good that it can do any thing you can in C.  I would appreciate that too.</div></div></body></html>