guile-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: MOP question


From: Thien-Thi Nguyen
Subject: Re: MOP question
Date: Tue, 23 Apr 2002 20:01:18 -0700

   From: Eric E Moore <address@hidden>
   Date: Mon, 15 Apr 2002 00:38:44 +0100


   The Goops MOP for generic application is basically undocumented.  I
   tried to figure it out looking at goops.scm, but am a little lost.

   Specifically, I can't quite figure out how apply-method is supposed
   to work.  Mostly, how (next-method) gets bound.

next-method is bound in libguile/goops.c, from which these two comments
may be helpful:

 * This implementation provides
 *      - generic functions (with class specializers)
 *      - multi-methods
 *      - next-method
 *      - a hard-coded MOP for standard gf, which can be overloaded for non-std 
gf

and
 
 * Protocol for calling a generic fumction
 * This protocol is roughly equivalent to (parameter are a little bit different
 * for efficiency reasons):
 *
 *      + apply-generic (gf args)
 *              + compute-applicable-methods (gf args ...)
 *                      + sort-applicable-methods (methods args)
 *              + apply-methods (gf methods args)
 *
 * apply-methods calls make-next-method to build the "continuation" of a a
 * method.  Applying a next-method will call apply-next-method which in
 * turn will call  apply again to call effectively the following method.

also note that "scm_slots_exists_p" has been changed recently in cvs to
"scm_slot_exists_p".

thi



reply via email to

[Prev in Thread] Current Thread [Next in Thread]