[Ecls-list] Calling a function from C

Steven_Kilby at kofax.com Steven_Kilby at kofax.com
Sat Oct 14 03:05:03 UTC 2006


Hi,

I have a file called hello.lsp with the following contents:

(in-package "MYP")
(proclaim '(si::c-export-fname hello))

(defun hello()
  '("A list with a string"))

In ecl I type the following:

(make-package "MYP" :use '("COMMON-LISP"))
(load "hello.lsp")
(compile-file "hello.lsp")

This produces a .fas file and should have an exported function name 
"myp_hello".

Then, from a C file I would like to do something similar to:

cl_safe_eval("(make-package "MYP" :use '(\"COMMON-LISP\"))");
cl_safe_eval("(load \"hello.fas\"));

cl_funcall(1, cl_intern(1, "myp_hello"));

The two calls to cl_safe_eval work as expected, but the call to cl_funcall 
fails.  Anyone have any ideas?

Thanks
Steven





More information about the ecl-devel mailing list