It is unusual to call non lisp code from lisp and is rarely required. CLX (the X11 client implementation for CL) does not refer to the Xlib implementation, but "speaks" X11 directly. On any system, your CL implementation probably already has excellent operating system hosts, which makes this unnecessary.
However, the answer depends on the implementation of lisp:
In ECL, you can place the CL environment under C and just call cl_eval() with the code to execute. This may allow you to write the application (or the host of the application) in C (or C ++) and βcallβ the lisp code.
There is a C-compatible calling interface in CCL that allows you to do something like this:
(with-cstrs ((x "Hello World")) (
In most other CL implementations (like SBCL, and yes, this also works in ECL and CCL), you can use UFFI (or CFFI), which simply allows you to call C functions, which other people are talking about. If that's all you want to do, CFFI is a good, safe place to start.
geocar Dec 19 '08 at 2:34 a.m. 2008-12-19 02:34 a.m.
source share