[Ecls-list] Best way to create classes and methods in c(++)?

Juan Jose Garcia-Ripoll juanjose.garciaripoll at gmail.com
Thu Feb 28 22:07:46 UTC 2013

On Thu, Feb 28, 2013 at 6:39 PM, Peter Enerccio <enerccio at 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)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.common-lisp.net/pipermail/ecl-devel/attachments/20130228/c878c9ca/attachment.html>

More information about the ecl-devel mailing list