Having been away from CFFI for several months, I thought I'd ask: what happened to callback-lambda? James Bielman implemented an interim solution, but it never made its way into mainline CFFI and I think has bitrotted by now. Any particular reason why?
As for me, a working callback-lambda under SBCL (and later ECL) would be a MAJOR win. Even more so if I could avoid memory leaks by being able to delete callbacks when they're no longer needed.
--J.
[Hello Jan. Sorry for the late reply!]
Jan Rychter jan@rychter.com writes:
As for me, a working callback-lambda under SBCL (and later ECL) would be a MAJOR win. Even more so if I could avoid memory leaks by being able to delete callbacks when they're no longer needed.
I can't seem to find the lambda-callback patch but, IIRC, we reached the conclusion that we could support this feature in a similar fashion to the way we support foreign-funcall and long-long on some Lisps.
The first step to integrate this feature into CFFI is to have someone actually use it, maybe write some tests. I doubt the patch (wherever it is) bitrotted much; can you apply it and/or let me know where it is? Let us know if it works for you or if you need any help.
On 6/25/06, Luís Oliveira luismbo@gmail.com wrote:
[Hello Jan. Sorry for the late reply!]
Jan Rychter jan@rychter.com writes:
As for me, a working callback-lambda under SBCL (and later ECL) would be a MAJOR win. Even more so if I could avoid memory leaks by being able to delete callbacks when they're no longer needed.
I can't seem to find the lambda-callback patch but, IIRC, we reached the conclusion that we could support this feature in a similar fashion to the way we support foreign-funcall and long-long on some Lisps.
The first step to integrate this feature into CFFI is to have someone actually use it, ...
Replicating CLisp's callback-lambda when porting Vasilis's original CLisp-only Cells-Gtk to UFFI was a huge pain. Maybe they would not mind ripping out all the nonsense I had to create (if ti is still there).
Well, come to think of it, I handle the Togl callbacks in Tcl/Tk by declaring fixed callbacks and having those call lambdas one can put in a slot of the CLOS class that wraps a C Togl widget. Hmmm. But I need portability: ACL, Lispworks, mebbe OpenMCL. Where would it run?
kt
maybe write some tests. I doubt the patch (wherever it
is) bitrotted much; can you apply it and/or let me know where it is? Let us know if it works for you or if you need any help.
-- Luís Oliveira luismbo (@) gmail (.) com http://student.dei.uc.pt/~lmoliv/
cffi-devel mailing list cffi-devel@common-lisp.net http://common-lisp.net/cgi-bin/mailman/listinfo/cffi-devel
On 2006-jun-25, at 19:27, Ken Tilton wrote:
Well, come to think of it, I handle the Togl callbacks in Tcl/Tk by declaring fixed callbacks and having those call lambdas one can put in a slot of the CLOS class that wraps a C Togl widget. Hmmm.
Right, I do similar dispatching in cl-glut.
But I need portability: ACL, Lispworks, mebbe OpenMCL. Where would it run?
From the top of my head: only SBCL, OpenMCL and CLISP.
"Luís" == Luís Oliveira luismbo@gmail.com writes:
Luís> [Hello Jan. Sorry for the late reply!] Jan Rychter Luís> jan@rychter.com writes:
As for me, a working callback-lambda under SBCL (and later ECL) would be a MAJOR win. Even more so if I could avoid memory leaks by being able to delete callbacks when they're no longer needed.
Luís> I can't seem to find the lambda-callback patch but, IIRC, we Luís> reached the conclusion that we could support this feature in a Luís> similar fashion to the way we support foreign-funcall and Luís> long-long on some Lisps.
Luís> The first step to integrate this feature into CFFI is to have Luís> someone actually use it, maybe write some tests. I doubt the Luís> patch (wherever it is) bitrotted much; can you apply it and/or Luís> let me know where it is? Let us know if it works for you or if Luís> you need any help.
Luis,
Here's the patch as originally sent by James Bielman. It used to work for me, but I've had problems recently. I haven't had time to debug them extensively, but it seems that the lambda list for inverse-translate-objects has changed over time.
I would be really interested in a working callback-lambda, at least on SBCL. Unfortunately, I'd also need a way to somehow free/delete unused callbacks later on, so as not to leak memory.
--J.