This is the mail archive of the guile@sources.redhat.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: How do I ... (Goops)


rm@mamma.varadinet.de writes:

> How do i write a generic method in C?
> I have managed to create goops objects from
> within my c library/module, following the
> example code in fdi.c but i cannot find any
> documentation on how to write methods that
> operate on these objects.
> Any ideas on how to proceed?

I'm sorry to say that, as far as I'm aware of, no progress has been
made on the C API for GOOPS.  There doesn't currently exist an easy
way to add methods from the C level.

The current way to do it is this:

To create a generic:

gf = scm_make (SCM_LIST3 (scm_class_generic, k_name, NAME));

To add a method:

scm_add_method (gf, scm_make (SCM_LIST5 (scm_class_method,
          			         k_specializers,
					 SCM_LISTn (SPEC1, SPEC2, ...),
					 k_procedure, PROC)));

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