Google News
logo
Lisp - Interview Questions
How to Creating a LISP Package?
The defpackage function is used for creating an user defined package.

It has the following syntax :
(defpackage :package-name
   (:use :common-lisp ...)
   (:export :symbol1 :symbol2 ...)
)​

Where,

* package-name is the name of the package.

* The :use keyword specifies the packages that this package needs, i.e., packages that define functions used by code in this package.

* The :export keyword specifies the symbols that are external in this package.

The make-package function is also used for creating a package. The syntax for this function is :
make-package package-name &key :nicknames :use​
Advertisement