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

Peter Enerccio enerccio at gmail.com
Thu Feb 28 22:32:01 UTC 2013


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 at gmail.com>

>
> 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?
>
> Juanjo
>
> --
> Instituto de Física Fundamental, CSIC
> c/ Serrano, 113b, Madrid 28006 (Spain)
> http://juanjose.garciaripoll.googlepages.com
>



-- 
Bc. Peter Vaňušanik
http://www.bishojo.tk
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.common-lisp.net/pipermail/ecl-devel/attachments/20130228/0ec1843c/attachment.html>


More information about the ecl-devel mailing list