Re: [Ecls-list] compile package dependencies to C
Yes, that worked. Now, about the name mangling - is there any way to control it? For example, i had a (defun main ... which got renamed to L1main(). Not so bad yet, but the top-level LISP code gets wrapped in a function with a completely random and unpredictable name like _eclpXiVf4X4_TkyRds01(cl_object flag). And this brings me to my next question - how do i keep the startup code so the C file can be built with gcc/ld at a later time? I didnt find it in the ~/.cache/common-lisp/... cheers! From: juanjose.garciarip...@gmail.com Date: Sat, 2 Mar 2013 09:48:06 +0100 To: mm_li...@pulsar-zone.net CC: ecls-list@lists.sourceforge.net Subject: Re: [Ecls-list] compile package dependencies to C On Fri, Mar 1, 2013 at 11:26 PM, Matthew Mondor mm_li...@pulsar-zone.net wrote: I've not tried it with asdf, but does setting C::*DELETE-FILES* to NIL help? This will leave the files, but ASDF makes pretty ugly names and places the files in a common location (~/.cache/common-lisp/...) For debugging it is normally enough, though -- Instituto de FĂsica Fundamental, CSIC c/ Serrano, 113b, Madrid 28006 (Spain) http://juanjose.garciaripoll.googlepages.com -- Everyone hates slow websites. So do we. Make your web apps faster with AppDynamics Download AppDynamics Lite for free today: http://p.sf.net/sfu/appdyn_d2d_feb ___ Ecls-list mailing list Ecls-list@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/ecls-list -- Symantec Endpoint Protection 12 positioned as A LEADER in The Forrester Wave(TM): Endpoint Security, Q1 2013 and remains a good choice in the endpoint security space. For insight on selecting the right partner to tackle endpoint security challenges, access the full report. http://p.sf.net/sfu/symantec-dev2dev___ Ecls-list mailing list Ecls-list@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/ecls-list
Re: [Ecls-list] compile package dependencies to C
On Thu, 7 Mar 2013 13:26:22 -0500 Sam Sam gamgee...@hotmail.com wrote: Now, about the name mangling - is there any way to control it? For example, i had a (defun main ... which got renamed to L1main(). Not so bad yet, but the top-level LISP code gets wrapped in a function with a completely random and unpredictable name like _eclpXiVf4X4_TkyRds01(cl_object flag). ECL makes sure to create unique C symbols to avoid clashes, but it also creates CL-side symbols pointing to them. Your C code can query those symbols. If using CLINES, then there is even some syntactic sugar provided by the ECL C preprocessor, and C-INLINE can be told that an argument is of type FUNCTION. Also, cl_funcall() accepts a function object (which could have previously been obtained using cl_symbol_function()) or a symbol object directly, just like CL FUNCALL accepts a function designator. Examples: CLINES: { cl_object res; res = cl_funcall(1, @symbol); /* ... */ } otherwise (untested, I hope I got this right): { cl_object sym, fun, res; sym = cl_make_symbol(cl_string(MAIN)); res = cl_funcall(1, sym); /* * Cache function object to avoid constant symbol lookup, * useful if calling the function very frequently, but problematic * if the function is redefined in CL, so beware for interactive * development. */ fun = cl_symbol_function(sym); res = cl_funcall(1, fun); } -- Matt -- Symantec Endpoint Protection 12 positioned as A LEADER in The Forrester Wave(TM): Endpoint Security, Q1 2013 and remains a good choice in the endpoint security space. For insight on selecting the right partner to tackle endpoint security challenges, access the full report. http://p.sf.net/sfu/symantec-dev2dev ___ Ecls-list mailing list Ecls-list@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/ecls-list