On Mon, May 13, 2013 at 12:33 PM, Ala'a Mohammad <amal...@gmail.com> wrote:
> This is my first try at ECL, and need help in figuring out what is
> missing. I had tried googling for similar examples but did not found one
> that demoed what i wanted.
>
There are many examples out there how to call Common Lisp functions. Indeed
many in this very same mailing list explain how to call cl_boot(),
ecl_read_from_cstring(), cl_funcall() and friends. Directly calling a
Common Lisp function compiled by you by name is not recommended.
> (proclaim '(si::c-export-fname sum-arary))
>
In order to have compile-time side effects you need to fix the name and use
(eval-when (:compile-toplevel)
(proclaim '(si::c-export-fname sum-array)))
// summ-array
> ////demo_sum_array = dlsym(libhandle,"demo_sum_array");
> demo_sum_array = dlsym(libhandle,"L1sum_array");
> if(demo_sum_array == NULL) {
> /* ERROR HANDLING */
> fprintf(stderr, "%s\n", dlerror());
> exit(1);
> }
>
Broken, broken, broken. ECL has to be bootstrapped before calling any
function. This involves a well defined protocol that starts by calling
cl_boot() with two arguments and, optionally, registering any additional
threads from which code may be invoked. Then you can start using Common
Lisp functions and objects.
Juanjo
--
Instituto de FĂsica Fundamental, CSIC
c/ Serrano, 113b, Madrid 28006 (Spain)
http://juanjose.garciaripoll.googlepages.com
------------------------------------------------------------------------------
AlienVault Unified Security Management (USM) platform delivers complete
security visibility with the essential security capabilities. Easily and
efficiently configure, manage, and operate all of your security controls
from a single console and one unified framework. Download a free trial.
http://p.sf.net/sfu/alienvault_d2d
_______________________________________________
Ecls-list mailing list
Ecls-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ecls-list