Re: Generics vs. Message passing: object namespaces
Dave Roberts <[email protected]> Sun, 25 Feb 2007 19:20:38 -0800
| Newsgroups | gmane.comp.lang.lightweight |
|---|---|
| Message-ID | <[email protected]> |
On Fri, 2007-02-23 at 09:15 +0000, Tom Locke wrote: > Dave Roberts: > > When I first encountered CLOS, coming from > > a standard C++ -> Java background, it seemed downright strange. ... > > Having worked with CLOS more now, I really appreciate the CLOS model. > > The points you've raised are not in question - the generic function > approach undoubtedly yields a lot of expressive power. I'm just > asking if the price is a loss of nice method names, or is there a > best of both worlds solution? Is there a price in the loss of nice method names? No, I don't think so. Whether or not a function is bound tightly to a given object definition, one can still have the same set of names. A generic function and an object definition can still be developed in concert, can still live in the same file. As Pascal has said, they can be disambiguated from each other with a package name. In short, I have not found any issues with method naming becoming more verbose in the case of CLOS. IMO, it really is the best of both worlds because in the degenerate case it's easy to program with CLOS in a style that is very similar to a "standard" object model with tightly bound methods and classes and single dispatch. But CLOS just gives you so much more if you choose to use it. -- Dave