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


[Apologies if I am rehashing an issue which has been previously discussed
-- the local CLOS archives are presently inaccessible.]

with-added-methods seems incompatible with the restriction (mentioned in
the doc for add-method) that a method can only be added to one generic
function at a time.

The doc for with-added-methods says:
  Each generic function is created by adding the set of methods
  specified by its method definitions to a copy of the lexically visible
  generic function of the same name and its methods.
That for add-method says:
  If the method object is a method object of another generic function,
  an error is signaled.

I would think that the new generic function created by
with-added-methods must share all all the methods which were defined on
the original generic function.

I suppose that an alternate reading of the first piece of documentation
is ``to a copy of the lexically visible generic function of the same
name and TO A COPY OF its methods'' -- I'd like to think that this isn't
what was intended, since it would seem to introduce far more problems
than it solves.

Some passing remarks about with-added-methods:
 * Does it really need to be a special form rather than a macro?
   I -believe- I could define it in terms of generic-flet -- however,'
   I haven't thought this through very thoroughly.
 * Is there sufficient Chapter 3 support to enable this kind of thing to
   be `portably' implemented?  Apart from the above-mentioned lossage
   involving methods added to more than one generic function, there are
   problems brushed under the rug by ``A COPY OF the lexically
   visible generic function.''  Presumably there needs to be some
   cloning method for generic functions.
 * I guess I'll never actually use with-added-methods in any case
   because of inefficiencies due what I perceive as the fatal problem
   with method-combination...