On Tue, Nov 6, 2012 at 12:31 AM, Peter Enerccio <enerc...@gmail.com> wrote:

> I am using this kind of macro:
>

> #define DEFUN( name, argcount, fpointer) do { \
>     cl_def_c_function(c_string_to_object(name), \
>             (cl_objectfn_fixed)fpointer, \
>             argcount); \
>     } while (0)
>
>
This code is wrong. If you want to create a function with a variable number
of arguments, the function F should have signature

cl_object F(cl_narg narg, ...)

and be defined with

ecl_def_c_function_va(symbol, F)

If you instead want to use a function with a fixed number of arguments (say
2), then the signature should be

cl_object F(cl_object arg1, cl_object arg2)

and be defined with

ecl_def_c_function(symbol, F, 2)

But this is strongly discouraged and not future proof: write the code in
lisp and let ECL compile it.

Juanjo

-- 
Instituto de FĂ­sica Fundamental, CSIC
c/ Serrano, 113b, Madrid 28006 (Spain)
http://juanjose.garciaripoll.googlepages.com
------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_nov
_______________________________________________
Ecls-list mailing list
Ecls-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ecls-list

Reply via email to