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: Klaus.Schilling@home.ivm.de
- Subject: Re: creating goops classes in C library wrappers
- From: Mikael Djurfeldt <mdj@mdj-pc.nada.kth.se>
- Date: 06 Sep 1999 18:41:12 +0200
- Cc: guile@sourceware.cygnus.com
- Cc: djurfeldt@nada.kth.se
- References: <m11Numz-000H3wC@debian>
Klaus Schilling <Klaus.Schilling@home.ivm.de> writes:
> Would it make much sense to define new goops classes coming from new
> smob types in library wrappers already on C level?
Yes, I think so.
> 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.
> Is it planned to provide facilities for such a goops interfacing on
> C level?
It is already implemented. Wrapper classes for all smobs created with
the new smob interface should be exported from the (oop goops) module,
regardless of when they are created.
(When we have the new module system they will be exported from the C
level module of the smob.)