[Ecls-list] how to cache a cl_object in C?

Juan Jose Garcia-Ripoll juanjose.garciaripoll at googlemail.com
Thu Mar 25 13:50:43 UTC 2010


On Thu, Mar 25, 2010 at 1:06 PM, yami <yamisoe at gmail.com> wrote:

> Hi,
>
> I have following pseudo code:
>   cl_object some_object =  si_safe_eval(3, c_string_to_object("(blah
> blah)"), Cnil, OBJNULL);
>   for (i=0; i<LARGE_NUMBER; i++) {
>       cl_funcall(2, cl_intern(1,
> make_simple_base_string("use_some_object")), some_object);
>   }
>
> It seems that after some iterations, the value of some_object changed...
> Any ideas?
>

If "some_object" is in a thread that is know to ECL and it is an automatic
(i.e. stack) C variable, the object will not change.


> BTW: it is a pain to deal with ECL & C, because no good documentation is
> available.
> Why there is no good doc work here?


Lack of time? There is currently one man working on this, plus contributed
patches. Users have produced pages at the wiki, but nobody has contributed a
documentation of existing functions / types. I myself spend 100% time right
now solving bugs, adding requested features, porting to platforms, and
answering email -- no pun intended :-)

There is also the fact that in ECL, except for c_string_to_object, the
optional si_safe_eval(), and a couple of functions, there are no other
functions required except those listed in the ANSI Common Lisp standard,
which are translated word-by-word in to their C equivalents (COS -> cl_cos,
etc)


> Especially for integrating ECL and C programs, which is a selling-point of
> ECL.
>

Embeddability is not the only selling point of ECL. It is extremely
portable, allows multithreading, it can also produce standalone programs,
small executables, shared libraries, delivered without problems, it
integrates well with C language allowing the opposite (and usually simpler)
practice, which is using C from lisp, easy FFI, ...

-- 
Instituto de Física Fundamental, CSIC
c/ Serrano, 113b, Madrid 28006 (Spain)
http://tream.dreamhosters.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.common-lisp.net/pipermail/ecl-devel/attachments/20100325/b8aada35/attachment.html>


More information about the ecl-devel mailing list