[plt-scheme] Swindle question: multiple gf defs with the same name

From: Eli Barzilay (eli at barzilay.org)
Date: Sat Aug 7 17:22:33 EDT 2004

On Aug  7, Doug Orleans wrote:
> [Is there a separate list for Swindle discussion?  Or is this the
> place for it?]

[I have a list `thing' but it's not really intended for this.  Swindle
will crawl into PLT at some point anyway...]

> If two modules have defmethod forms with the same name, but neither
> module requires the other, you end up with two gfs with the same
> name.  Then if you require both modules you get a name clash.  Is
> there a usual way of dealing with this?  How is this done in CLOS,
> or Dylan?  I suppose you could add all the methods of one gf onto
> the other, or add all the methods on both to a new gf, but these
> seem like kludges.

Well, you do need some place to define the class -- I'd put a
defgeneric there and make sure it's provided, so the other defmethods
will add to it instead of defining new bindings.

(In CLOS there is no problem because there is no module system, so you
can have (defmethod foo::bar ...) inside a file that defines another

          ((lambda (x) (x x)) (lambda (x) (x x)))          Eli Barzilay:
                  http://www.barzilay.org/                 Maze is Life!

Posted on the users mailing list.