(setq value (list arg0 arg1 arg2))where argn may be any lisp expression, including variable references, other function calls, etc. In the most general case, this appears in code translated to C as:
{ clObject L_0, L_1, L_2;
clSetq(L_0, arg0);
clSetq(L_1, arg1);
clSetq(L_2, arg2);
clSetq(value, clList(L_0, L_1, L_2, clEOA)); }
The temporary variables may be necessary, in general, because:
clSetq(value, clList(arg1, arg2, arg3, clEOA));
clEOA. This marker is defined in eclipse.h
and is used to denote the End Of Arguments to all Lisp function calls.
This is used by Lisp functions to do argument parsing and checking.
Note that the symbol EOA does not appear in the
Lisp source code. It is added automatically by compile-file.
In general, the calling mechanism may go through other levels of indirection, such as through the symbol-function of a symbol. See "Implementation of Lisp" for more information. The current version of Eclipse does not provide user control over when this additional indirection is performed for Lisp functions.
clEOA, as describe above.
When an ordinary C function is to be called from Lisp code that has
been translated to C by compile-file,
compile-file must not add the clEOA
marker or use any function reference
indirection.
This can be avoided by providing a c:function or c:macro compound type specifier ftype declaration in the Lisp source code. Just as C functions must be declared before they are used in C source code, they must be declared before they are used in Lisp source code that is translated to C by compile-file. Of course, it is not necessary to declare Lisp functions before use, regardless of whether those Lisp functions are implemented in C.
Note that a C macro referenced by Lisp source code must be a function-like macro in that it must expand into a C expression, not one or more statements. At this time, compile-file makes no special provision to avoid multiple evaluation of arguments to a c:macro.
At this time, there is no special mechanism to call a C function from code that has not been processed by compile-file (eg. interpreted code in the Lisp top level). For example, a programmer may define a function in C that is compiled and linked to the library to create a new application -- possibly even an application (such as the Eclipse top-level) that calls clLispTopLevel. If it is desired that this hand-written C function should provide such Lisp features as being fbound and callable by interpreted Lisp code, then the programmer will also have to write code to create a symbol identifying the function, and (setf symbol-value) of the symbol to a closure referencing the C function. Details are discussed in "Implementation of Lisp".