Subject: Re: newbie: using packages and CLOS From: Erik Naggum <firstname.lastname@example.org> Date: 30 Aug 2002 01:36:59 +0000 Newsgroups: comp.lang.lisp Message-ID: <email@example.com> * Gregory Bird | Is it OK to place each class definition and corresponding methods in a | separate file (without packages)? You should always use `defpackage´ to define the package and `in-package´ to instruct the reader to use that package for the remainder of the file (or until another `in-package´, but this is often confusing). `use-package´ is not a user-level function, contrary to its appealing name; it is used by the package system internals and is made available to the programmer because you sometimes want to mess with a package at runtime. Common Lisp has many functions that are there for the expert user but should not be used casually. Likewise, when you run your application, use `in-package´ to switch to that package. You should not let the Common-Lisp-User package use your package. | How do lisp programmers keep their code organized? Three Files for the Elven-kings under the sky, Seven for the Dwarf-lords in their halls of stone, Nine for Mortal Men doomed to die, One for the Dark Lord on his dark throne, In the Land of Mordor where the Users lie. One `defsystem´ File to rule them all, One `defpackage´ File to find them, One `defapplication´ File to bring them all and in the darkness bind them, In the Land of Mordor where the Users lie. -- Erik Naggum, Oslo, Norway Act from reason, and failure makes you rethink and study harder. Act from faith, and failure makes you blame someone and push harder.