This is the mail archive of the guile@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: CLOS-style MOP for Guile ?


Miroslav Silovic <silovic@zesoi.fer.hr> writes:

> Mikael Djurfeldt <mdj@nada.kth.se> writes:
> 
> > If we have stored a generic function object in a variable in the
> > module `used1' and the variable binding is exported, that means that
> > whenever we add methods to the object, those methods will also be
> > visible in the module `used1'.
> 
> This means that define-generic-method should be renamed to
> define-generic-method! (as it changes its first argument)?

Well, we haven't found the solution yet.  The behaviour I described
above was only meant to show how badly CLOS in the present form mixes
with Scheme.  Also, `define-generic-method' has a certain resemblance
to `define' which doesn't have a `!' either.

BTW, regarding my suggestion to copy the generic function object when
exporting bindings: Mike later pointed out to me that it isn't enough
to copy the object.  One would actually want the "inherited" generic
function to combine the methods from all used modules.

Note how these mechanisms resemble multiple inheritance.

It is really a very good idea in Java to combine package, module, and
object system.

/mdj