Does ECL support callbacks?

It is trivial when the question arises, but after a while, looking at the ECL documentation, CFFI documentation and resorting to Google, I still could not come to a final answer. The ECL docs don't say anything about callback syntax, the CFFI docs don't mention any implementation restrictions regarding callbacks in the ECL, and I can't use the pages Google is hinting at for the boolean.

+4
source share
1 answer

ECL supports callbacks in both interpreted and compiled mode. CFFI takes care of everything for you, so there is not much mention of ECL (why should it be?). If you care about the actual implementation, look at ecl / src / lsp / ffi.lsp. Signature for FFI: DEFCALLBACK (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 (the syntax type is one and the same, UFFI), but it explicitly names each of the arguments (arg-name) and provides the code in lisp for execution.

+6
source

Source: https://habr.com/ru/post/1399693/


All Articles