This is the mail archive of the
guile@sources.redhat.com
mailing list for the Guile project.
Re: How do I ... (Goops)
- To: rm at mamma dot varadinet dot de
- Subject: Re: How do I ... (Goops)
- From: Mikael Djurfeldt <mdj at mdj dot nada dot kth dot se>
- Date: 25 Jul 2000 16:19:01 +0200
- Cc: guile at sourceware dot cygnus dot com
- Cc: djurfeldt at nada dot kth dot se
- References: <20000711184754.C4480@mail.aura.de>
- Reply-To: djurfeldt at nada dot kth dot se
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)));