Next: Importing Individual Names, Previous: Defining Your Own Packages, Up: Common Lisp Package System [Contents][Index]
Define a new package, but export certain names to make them available to other packages.
(defpackage :com.gigamonkeys.email-db (:use :common-lisp) (:export :open-db :save :store))
The ‘:export’ clause specifies names that will be external in ‘COM.GIGMONKEYS.TEXT-DB’ and thus accessible in packages that ‘:use’ it. After you have defined this package, you can change the definition of the main application package to the following:
(defpackage :com.gigamonkeys.email-db (:use :common-lisp :com.gigamonkeys.text-db))
Now case written in ‘COM.GIGMONKEYS.EMAIL-DB’ can use unqualified names to refer to the exported symbols from both ‘COMMON-LISP’ and ‘COM-GIGAMONKEYS.TEXT-DB’. All other names will continue to be interned directly in the ‘COM.GIGAMONKEYS.EMAIL-DB’ package.