[cffi-devel] cffi-manual: foreign-free example
clisp from CVS head, cffi-051229.tar.gz CFFI[11]> (foreign-alloc 32) *** - Unknown CFFI type: 32. Thanks! -- WBR, Yaroslav Kavenchuk.
Yaroslav Kavenchuk <kavenchuk@jenty.by> writes:
CFFI[11]> (foreign-alloc 32)
Fixed the example, thanks. -- Luís Oliveira luismbo (@) gmail (.) com Equipa Portuguesa do Translation Project http://www.iro.umontreal.ca/translation/registry.cgi?team=pt
make-pointer example: CFFI[21]> (make-pointer 42) #<FOREIGN-ADDRESS #x0000002A> CFFI[22]> (pointerp *) T CFFI[23]> (pointer-adress **) *** - EVAL: undefined function POINTER-ADRESS Thanks! -- WBR, Yaroslav Kavenchuk.
On 2005-dec-30, at 12:47, Yaroslav Kavenchuk wrote:
*** - EVAL: undefined function POINTER-ADRESS
Thanks, fixed. -- Luís Oliveira http://student.dei.uc.pt/~lmoliv/ Equipa Portuguesa do Translation Project http://www.iro.umontreal.ca/translation/registry.cgi?team=pt
foreign-type-size: CFFI[56]> (defcstruct foo (a :double) (c :char)) FOO CFFI[57]> (foreign-type-size :double) 8 CFFI[58]> (foreign-type-size :char) 1 CFFI[59]> (foreign-type-size 'foo) 16 ;; in example - 12 foreign-alloc: CFFI[72]> (foreign-alloc :int :initial-contents '(1 2 3)) #<FOREIGN-ADDRESS #x012D54A0> CFFI[73]> (loop for i from 0 below 3 collect (mem-ref * :int i)) (1 33554432 131072) CFFI[74]> (foreign-alloc :int :initial-contents #(1 2 3)) #<FOREIGN-ADDRESS #x012D5578> CFFI[75]> (loop for i from 0 below 3 collect (mem-ref * :int i)) (1 33554432 131072) Oops? Thanks! -- WBR, Yaroslav Kavenchuk.
On 2005-dec-30, at 13:08, Yaroslav Kavenchuk wrote:
CFFI[59]> (foreign-type-size 'foo) 16 ;; in example - 12
Well.. it /could/ be 12. :-)
CFFI[74]> (foreign-alloc :int :initial-contents #(1 2 3)) #<FOREIGN-ADDRESS #x012D5578> CFFI[75]> (loop for i from 0 below 3 collect (mem-ref * :int i)) (1 33554432 131072)
Oops, another typo. Fixed. Thanks. -- Luís Oliveira http://student.dei.uc.pt/~lmoliv/ Equipa Portuguesa do Translation Project http://www.iro.umontreal.ca/translation/registry.cgi?team=pt
participants (2)
-
Luís Oliveira
-
Yaroslav Kavenchuk