Steven_Kilby | 14 Oct 05:05 2006

Calling a function from C

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
(Continue reading)

Steven_Kilby | 14 Oct 05:39 2006

Re: Calling a function from C

Hi,

Nevermind, I've figured it out.  I can call myp_hello directly.  I need to 
use the LISP symbol if I am going to call cl_funcall.

Thanks
Steven

Steven_Kilby@... 
Sent by: ecls-list-bounces@...
10/13/2006 08:05 PM

To
ecls-list@...
cc

Subject
[Ecls-list] Calling a function from C

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:
(Continue reading)


Gmane