[Ecls-list] Binding C/C++ Functions From Calling C/C++ Code

Nikhilesh S s.nikhilesh at gmail.com
Tue Feb 24 00:43:09 UTC 2009


On Mon, 23 Feb 2009, Juan Jose Garcia-Ripoll wrote:

> On Thu, Feb 19, 2009 at 6:58 AM, Nikhilesh S <s.nikhilesh at gmail.com> wrote:
>> I wanted to ask whether there's any function in the ECL C library to
>> bind a C function from a program to a Lisp function. [...]
>> cl_bind(&add, "c-add", /*min params*/ 1, /*max params*/ 1);
>
> Hi, and first of all sorry about the late answer. ECL cannot bind
> arbitrary C functions to lisp symbols. The reason is pretty obvious:
> Lisp functions take and return lisp objects and have pretty well
> defined and limited calling conventions. C/C++ functions do not.
>
> There are several approaches to what you want to do.
>
> 1) Write a Lisp wrapper that follows our calling conventions. Something like

Yep, got it now. I just didn't know thre was a 'cl_def_c_function()'.
;-)




More information about the ecl-devel mailing list