This is the mail archive of the
guile@sourceware.cygnus.com
mailing list for the Guile project.
Re: creating goops classes in C library wrappers
- To: Mikael Djurfeldt <mdj@mdj-pc.nada.kth.se>
- Subject: Re: creating goops classes in C library wrappers
- From: Martin Soto <masoto@uniandes.edu.co>
- Date: 06 Sep 1999 14:27:32 -0500
- Cc: Klaus.Schilling@home.ivm.de, guile@sourceware.cygnus.com, djurfeldt@nada.kth.se
- References: <m11Numz-000H3wC@debian> <xy7d7vwngbb.fsf@mdj-pc.nada.kth.se>
Mikael Djurfeldt <mdj@mdj-pc.nada.kth.se> writes:
> Klaus Schilling <Klaus.Schilling@home.ivm.de> writes:
> > This might influence guile-curses a lot, if one could define e.g a
> > <window> class, and many generic functions wrapping curses library
> > calls. It may be even better for libraries like gtk or some database
> > libraries.
>
> Yes. Also note the possibility not to implement the window as a smob
> but rather as a <foreign-object> (see undocumented example in
> goops-core/fdi.c). A <foreign-object> is a lisp cell with a pointer
> to an arbitrary C struct in its CDR, just as a smob, so very little
> resources are spended. It is possible to define accessors for the
> different fields in the struct on the C level.
What about defining goops methods from the C level as well? From the
fdi.c example it seems clear that you can easily provide accesors to
the fields of the structure, but I can't see how to provide access to
the C functions that work on that structure. Particularly, I would
like to be able to "define-generic" and "define-method" directly from
the C level, and in such a way that the newly defined method is
implemented in C. Is that possible at all?
M. S.
------------
Martin A. Soto J. Profesor
Departamento de Ingenieria de Sistemas y Computacion
Universidad de los Andes masoto@uniandes.edu.co