Another way of defining packages is to use “defpackage”m this appears to include all of the previous make-package things, it allows for the definition of functions which need to be exported (the public interface of the package), which functions need to be imported and from where.

To define a package we do:

(defpackage dave)

There are various options we can supply to defpackage which the Hyperspec gives as:

option::= (:nicknames nickname*)* |
          (:documentation string) |
          (:use package-name*)* |
          (:shadow {symbol-name}*)* |
          (:shadowing-import-from package-name {symbol-name}*)* |
          (:import-from package-name {symbol-name}*)* |
          (:export {symbol-name}*)* |
          (:intern {symbol-name}*)* |
          (:size integer)

These allow us to do various things which make-package allows us to do separately.

The Hyperspec for packages is here.

A very basic example is:

(defpackage dave
    (:documentation "Dave's package"))

The other options work in a similar way.