[cffi-devel] Can closures be used as callbacks in CFFI?

Bruno Daniel bruno.daniel at gmx.net
Tue Sep 18 10:52:01 UTC 2007


Dear developers,

can closures be used as callbacks, i.e. will the following kind of code work?

(let ((ptr nil))
  (let ((a 3))    
    (defcallback add-a :int ((b :int))
      (+ a b))
    (setq ptr (callback add-a)))
  (c-function ptr))
 
Best regards
  Bruno Daniel



More information about the cffi-devel mailing list