[Ecls-list] Tighter c/c++ integration, toplevel inline c/c++ code ???

Seth Burleigh seth at tewebs.com
Mon May 3 12:14:23 UTC 2010


I wasn't thinking of callbacks per se. Jus being able to define a c
function which takes c types which will then convert the c tyeps to lisp
types and then call the appropriate lisp function.

I imagine some macro like this

(defc (test :int) ((structure1 a) (void* e) (int b) (double c))
  ;;do something)

which would expand to code like this:
(progn
	(cin 
	"
	int test (structure1 a, void* e, int b , double c) {
  	//do type checking, interconvert, etc...
  	//...
  	//call lisp function 
  	cl_object result = gen_Test(altered_a,altere_e,....);
        return TO_FIXNUM(result);
	}")

	(defun gen_Test ...)
        (ffi:clines "//export test function"))

Or i could imagine a macro which allows me to define a unique c++ class,
by converting the class into c++ code, compiling it, and then i can use
the class in any inlined c++ code in the interpreter. If thats possible.









More information about the ecl-devel mailing list