[Ecls-list] c-inline and multiple values

Juan Jose Garcia Ripoll lisp at arrakis.es
Tue Jan 25 03:35:00 UTC 2005


Hi Julian,

the problem is that defentry is intended for C functions that return C
objects, not C functions that know about ECL. The reason is that
DEFENTRY generates a wrapper around the function that you declare, and
this wrapper in turn produces the output values that your lisp code
understands. Actually DEFENTRY is just a macro that expands into a
C-INLINE form: try using macroexpand on it!

Does your function take lisp objects as arguments? Then you can simply
register it with cl_def_c_function/cl_def_c_function_va.

If not, an example of what you are trying to do would be nice, so that I
can either suggest some other possibility or rewrite C-INLINE to suit
your needs.

Juanjo

Julian Stecklina wrote:

>Hello,
>
>is it possible to return multiple values from a c-inline form? Or if
>that is not possible, how do I make the runtime aware of a C function
>returning multiple values?
>
>Say if I have
>
>(Clines
>"
>cl_object static foo (..)
>{
>        ...
>        NVALUES=2;
>        VALUES(0) = ...;
>        VALUES(1) = ...;
>        return VALUES(0);
>}
>")
>
>When I do a:
>
>(defentry foo ...)
>
>and call that, it seems from the C code generated, that the multiple
>values are lost. Is this true?
>
>Regards,






More information about the ecl-devel mailing list