Trivial as the question sounds, but after some time looking through the ECL documentation, CFFI documentation and resorting to google, I still could not arrive to a definitive answer. ECL docs mention nothing of a callback syntax, CFFI docs do not mention any implementation restrictions in regards to callbacks in ECL, and I can not cast the pages that google hints at to logical.

有帮助吗?

解决方案

ECL does support callbacks both in interpreted and compiled mode. CFFI takes care of everything for you, which is why there is no specific mention of ECL (why should there be?). If you care about the actual implementation look at ecl/src/lsp/ffi.lsp. The signature for FFI:DEFCALLBACK is (defmacro defcallback (name ret-type ((arg-name arg-type)*) &body body) In other words, it takes more or less the same arguments as DEF-FUNCTION (type syntax is the same, UFFI) but it explicitely names each of the arguments (arg-name) and provide code in lisp to be executed.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top