What I want is to use c preprocessor to generate easy wrappers around c++ class methods. For every class, I would like to make a
lisp class, which would have one slot containing the actual void* point, and macros would generate functions which will autocast
cl_object and/or the slot value of the item into c++ type. However, what I would like is to install new methods for these c functions.

2013/2/28 Juan Jose Garcia-Ripoll <juanjose.garciaripoll@gmail.com>

On Thu, Feb 28, 2013 at 6:39 PM, Peter Enerccio <enerccio@gmail.com> wrote:
I am yet on the writing api in c++ for ecl, but I am quite puzzled on how to create basic things, such as lisp methods/classes directly in c environment? The documentation is silent about this. Can anyone help?

There is no provision in C for dealing with CLOS objects, defgeneric or defmethod. It simply cannot be done because defclass, defgeneric and defmethod are not functions, but sophisticated macros that parse and modify their arguments in interesting (but complicated ways).

My suggestion is that you evaluate lisp code from C if you want to create new classes and methods. This may be done either from text or from S-expressions, as usual.

If this looks too cumbersome, could you explain what you want to achieve and how?


Instituto de Física Fundamental, CSIC
c/ Serrano, 113b, Madrid 28006 (Spain) 

Bc. Peter Vaňušanik