From: Patrick A. O'Donnell

Subject: Re: Different argument list for same method name

Date: 2000-11-15 14:58


    Date: Tue, 14 Nov 2000 22:14:53 -0500 (EST)
    From: Andy Latto <pobox.com at andy.latto>

    You could define the two different classes and generic functions in two
    different packages. Then the names of the two generic functions would be
    A:ADD, and B:ADD. A package that used both the A and B packages could
    specify which of these two symbols should be shadowed, enabling you
    to choose on a per-package basis which function would be referred to as
    ADD, and which would require package qualification, being referred to as
    A:ADD or B:ADD.

This is the second suggestion to proliferate packages merely to avoid
a name conflict.  True, the purpose of pacakges is to avoid name
conflicts, but the choice of what modules/symbols to put in which
packages should be a considered design choice, not a hack patch to fix
a problem that probably should not exist.

We haven't been told what the ADD operations on the two classes are
really intended to do, but my strong sense is that the program would
probably be better served by renaming them to use more perspicuous
names.  The fact that they require different argument lists indicates
to me that they are computing different things, and as such, should
say so.

If the multiple packages suggestions were adopted, then if one saw
(add x y)  in the code, would you easily and quickly know which ADD
was meant?

		- Patrick A. O'Donnell
		  <ascent.com at pao>