Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!wiley!scott From: scott@wiley.uucp (Scott Simpson) Newsgroups: comp.lang.lisp Subject: Using Packages With CLOS Keywords: packages, information hiding, CLOS classes, file naming conventions Message-ID: <26B09E74.58E0@wilbur.coyote.trw.com> Date: 27 Jul 90 20:05:07 GMT Sender: news@wilbur.coyote.trw.com (News Software) Organization: TRW Inc., Redondo Beach, CA Lines: 20 How do people use packages with CLOS classes? The most obvious solution to me would be to make a separate package for each class. My office mate objected to this, saying that it would cause problems with inheritance. He noted that symbols are local to a package and when you inherit from another class you would need to know the superclasses name to access any inherited slot. My retort was that you should provide accessor functions for superclass slots in your class and export them if you wish to enable the user of the class to access an inherited slot. Then if you changed the superclass for any reason the code behind the package wall would change but the accessor function used by the user using the class would not change. Another issue is the mapping between file names and CLOS classes. Do you normally create a different file for each CLOS class? This seems to me to be simple method for quickly identifying where classes are stored. If all the files are stored in the same directory, it regrettably flattens the type hierarchy structure you are trying to simulate but I think it is the best you can do without some sort of object-oriented database underneath. Scott Simpson TRW scott@coyote.trw.com Scott Simpson TRW scott@coyote.trw.com