Here's a code snippet which uses the 'with-alien' function from the ALIEN
package:
( with-alien (
( filename c-string )
( width int )
( height int )
( image_array ( * ( * unsigned-char ))))
( setf filename ( car *command-line-words* ))
( extract-image filename
( addr width )
( addr height )
( addr image_array ))
;********************************************
( dotimes ( w width ))
;********************************************
( setf ( array2d image_array 100 100 ) 0 )
( setf filename "del.jpg" )
( save-image filename width height image_array ))
This code works fine. But if I remove "( dotimes ( w width ))" I get the
following error when loading the fasl file:
-------------------------------
Type-error in KERNEL::OBJECT-NOT-TYPE-ERROR-HANDLER:
#.(SYSTEM:INT-SAP #x48001020) is not of type ALIEN::ALIEN-VALUE
Restarts:
0: [CONTINUE] Return NIL from load of #p"tel.x86f".
1: [ABORT ] Skip remaining initializations.
Debug (type H for help)
(DEREF 1 #.(SYSTEM:INT-SAP #x48001020))[:EXTERNAL]
Source: Error finding source:
Eorror in function DEBUG::GET-FILE-TOP-LEVEL-FORM: Source file no longer
exists:
target:code/alieneval.lisp.
-------------------------------
Is there any easy explanation for this behavior ?