This is the mail archive of the guile@sourceware.cygnus.com mailing list for the Guile project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: creating goops classes in C library wrappers


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.)

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]