[Ecls-list] Accessing C variables

Dean O'Connor dean.oconnor at ite.com.au
Thu Sep 1 20:49:02 UTC 2005


Forgive me if this has been asked before or is obvious but I cannot find 
any clear (to me :) information on this anywhere. Any pointers in the 
right direction would be appreciated.
(I've been doing a refresher in Lisp to get this working ... last time 
was in Uni .... a looooong time ago)

We have a C++ application (for windows/linux) and we can boot ECL and 
run scripts just fine.
Our plan is use interpreted (prob not pre-compiled) Lisp scripts to 
analyse data in the C++ apps memory and return basic decisions. 
Basically rule scripts.

The C++ datastructures can be quite large, so I am trying to avoid 
having to *copy* them into Lisp space.

Is there a way to point/bind to the existing C++ data structures in Lisp 
interpreter real time? So the Lisp scripts can understand and read the data.
The C++ structures could be classes, or structs, but could be reduced to 
more basic data-types.

I did read some info about FFI and CFFI but thought this was not quite 
the same thing ??
I have been looking at the XchatLisp plugin source for inspiration as I 
can't find many other sources.

Also the main reason we chose ECL was to replace our own in-house 
(limited) Lisp interpreter because it was not multi-threaded.
So thread-safety is also a main goal of ours, but a fully featured Lisp 
embeddable interpreter like ECL is the bonus :)

Thanks in advance

More information about the ecl-devel mailing list