Symbols

make-symbol name ⇒ new-symbol

copy-symbol symbol [copy-properties] ⇒ new-symbol

gensym [name] ⇒ new-symbol

Uses *gensym-counter*

(gensym)        ;⇒ #:G1123 (value of *gensym-counter*)
(gensym "name") ;⇒ #:|name1124|
(gensym 99)     ;⇒ #:G99

symbol-function symbol ⇒ contents

symbol-name symbol ⇒ name

symbol-package symbol ⇒ contents

symbol-plist symbol ⇒ plist

symbol-value symbol ⇒ value

get symbol indicator [default] ⇒ value

set symbol value ⇒ value

remprop symbol indicator ⇒ boolean

boundp symbol ⇒ boolean

makunbound symbol ⇒ symbol

Predicates

symbolp object ⇒ boolean

keywordp object ⇒ boolean

Advanced

*gensym-counter*

A number used by gensym to construct the name of the next symbol.

gentemp [prefix package] ⇒ new-symbol

Deprecated.

Packages

Standard Packages

  • common-lisp
  • common-lisp-user
  • keyword

*package*

*modules*

load filespec [:verbose :print :if-does-not-exist :external-format] ⇒ boolean

defpackage name [options…] ⇒ package

options are:

  • :nicknames
  • :use
  • :import-from
  • :shadow
  • :shadowing-import-from
  • :export
  • :intern
  • :size
  • :documentation
(defpackage :example-package
  (:nicknames :expkg :ex-pkg)
  (:use
    :cl
    :text-db
    :text)
  (:import-from :email :parse-email-address)
  (:shadow :my-name) ;ignore import version, use local
  (:shadowing-import-from :text-db ;resolve conflicting imports
    :save)
  (:export
    :my-fn))
(in-package :example-package)
(load "./src/example-package")
*package* ;⇒ #<Package "EXAMPLE-PACKAGE">

export symbols [package] ⇒ t

find-symbol string [package] ⇒ symbol, status

find-package name ⇒ package

find-all-symbols string ⇒ symbols

import symbols [package] ⇒ t

list-all-packages ⇒ packages

rename-package package new-name [new-nicknames] ⇒ package-object

shadow symbol-names [package] ⇒ t

shadowing-import symbols [package] ⇒ t

delete-package package ⇒ boolean

make-package package-name [:nicknames :use] ⇒ package

unexport symbols [package] ⇒ t

unintern symbol [package] ⇒ boolean

in-package name ⇒ package

unuse-package packages-to-unuse [package] ⇒ t

use-package packages-to-use [package] ⇒ t

intern string [package] ⇒ symbol, status

package-name package ⇒ name

package-nicknames package ⇒ nicknames

package-shadowing-symbols package ⇒ symbols

package-use-list package ⇒ use-list

package-used-by-list package ⇒ used-by-list

package-error-package condition ⇒ package

Predicates

packagep object ⇒ boolean

Iteration

do-symbols (var [package [result-form]]) declaration* {tag | statement}* ⇒ result

do-external-symbols (var [package [result-form]]) declaration* {tag | statement}* ⇒ result

do-all-symbols (var [result-form]) declaration* {tag | statement}* ⇒ result

with-package-iterator (name package-list-form &rest symbol-types) declaration* form* ⇒ result

Advanced

provide module-name ⇒ implementation-dependent

Deprecated.

require module-name [pathname-list] ⇒ implementation-dependent

Deprecated.

Systems

In example.asd:

(asdf:defsystem :example
  :serial t                ;load files in order
  :depends-on (:alexandria :cl-utilities)
  :components ((:file "package")
               (:file "example")))
`(ql:quickload :example)`