[Ecls-list] Callbacks in ECL (2)

Goffioul Michael goffioul at imec.be
Thu Aug 25 02:51:24 UTC 2005


Continuing the exercise of implementing callbacks in ECL, here's
a first working (dirty) solution. To try it:

(load "cmpcb.lsp")
(compile-file "cb-test.lsp" :c-file t)
(load "cb-test")
(dotest)

The file cmpcb.lsp contains the compiler hacks, some being ugly.
To push the wrapper as a local function, I couldn't rely on the
current new-local/t3local-fun functions, because t3local-fun assumes
function output and arguments are cl_object, which is not the case
for a callback. So I had to reimplement the work of t3local-fun
in the form of callback-wrapper (with some hacks to integrate it
into the main compilation process).

I guess a more elegant solution could make use of a new callback
structure, functions like emit-local-callbacks, t3local-callback
and new-local-callback. Another solution could re-user the existing
fun structure, but I have the impression that it would be more
complex. Finally, another possibility would be to merge the callback
and the wrapper code into a single function: at the beginning and
at the end of the body, some conversion routines could be added,
then the LISP body could be dumped normally. All this requires far
more understanding of the compiler than I have, I hope Juanjo or
someone else will find the time to have a look at it.

Bye.
Michael.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cmpcb.lsp
Type: application/octet-stream
Size: 2185 bytes
Desc: cmpcb.lsp
URL: <https://mailman.common-lisp.net/pipermail/ecl-devel/attachments/20050825/adc6a003/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cb-test.lsp
Type: application/octet-stream
Size: 955 bytes
Desc: cb-test.lsp
URL: <https://mailman.common-lisp.net/pipermail/ecl-devel/attachments/20050825/adc6a003/attachment-0001.obj>


More information about the ecl-devel mailing list