From ... Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!newsfeeds.belnet.be!news.belnet.be!ossa.telenet-ops.be!nmaster.kpnqwest.net!nreader1.kpnqwest.net.POSTED!not-for-mail Newsgroups: comp.lang.lisp Subject: Re: Is this an abuse of CLOS? References: <3229021358194544@naggum.net> Mail-Copies-To: never From: Erik Naggum Message-ID: <3229027497471150@naggum.net> Organization: Naggum Software, Oslo, Norway Lines: 30 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Mon, 29 Apr 2002 00:04:58 GMT X-Complaints-To: newsmaster@KPNQwest.no X-Trace: nreader1.kpnqwest.net 1020038698 193.71.199.50 (Mon, 29 Apr 2002 02:04:58 MET DST) NNTP-Posting-Date: Mon, 29 Apr 2002 02:04:58 MET DST Xref: archiver1.google.com comp.lang.lisp:32419 * Peter Seibel | Right. But I could always add new methods even if things did change, just | the same as I could change the mapping vector, right? Or is that a bad | idea in practice? I think adding a new method on read-cp-info is better. Using a vector of class names spreads the information to more places that need concurrent updates, which I think asks for trouble in the maintenance phase. | P.S. On second thought, I will ask that other question: suppose I have a | generic function like read-from that takes an object as an argument and I | want to have all methods on that function return that object. What's the | recommended way to achieve that? Should I define a main method that just | returns the argument and then do all my specialization in :before | methods? Or is this just the wrong way of looking at the problem? I think that is a clever way of forcing a protocol, but I am not such a fan of forcing protocols that I think you should actually do this, because if anyone should write a different main method out of ignorance of the protocol, you are probably worse off then if you simply document the protocol to return the value. You would probably have to document the protocol to use before methods, too. This is a tradeoff that you have to make based on many additional premises, however. /// -- In a fight against something, the fight has value, victory has none. In a fight for something, the fight is a loss, victory merely relief. Post with compassion: http://home.chello.no/~xyzzy/kitten.jpg