(rontolisp) docs
← cl Package Functions

make-package

(make-package name &key :use :nicknames)

Creates a package at run time and returns it -- the upcased canonical name as a keyword, like find-package. The name and nicknames are upcased the way the reader upcases source, so :my-pkg and "MY-PKG" name the same package. Each :use entry must name a package the program already knows (a built-in or a defpackage product); the new package starts empty. What intern, export, import, shadowing-import and shadow put into it is recorded in its member table -- on every backend -- so find-symbol, do-symbols and with-package-iterator see it and unintern can take it out again.

A name or nickname that collides with a registered package or nickname signals a catchable package-error, as does an unknown :use entry. Read/compile-time packages are never affected: creating over one signals instead of replacing it.