[Ecls-list] Small embedding example

Rui Maciel rui.maciel at gmail.com
Mon Nov 2 08:09:13 UTC 2009


Here is a small example on how to embed ECL into an application. It's very 
rudimentary but I believe it will help jump start anyone who wishes to get 
their hands dirty on ECL.


<code>
#include <stdio.h>
#include <ecl/ecl.h>


int main(int argc, char **argv)
{
        cl_object form, result;
        cl_object princed;
        cl_object g_eclEvalErrorSymbol;

        cl_boot(argc, argv);

        form = c_string_to_object("(+ 1 1)");

        result = si_safe_eval(3, form, Cnil, g_eclEvalErrorSymbol);
        princed = cl_princ_to_string(1, result);
        printf("output: %s\n",(char *)princed->base_string.self);

        cl_shutdown();
        return (0);
}
</code>




More information about the ecl-devel mailing list