ToC DocOverview CGDoc RelNotes Index PermutedIndex
Allegro CL
Home Previous Up Next Table of Contents Index
  ANSI Common Lisp   11 Packages   11.2 Dictionary of Packages

11.2.3 find-symbol Function

Syntax:
find-symbol string &optional package    symbol, status

Arguments and Values:
string - a string.

package - a package designator. The default is the current package.

symbol - a symbol accessible in the package, or nil.

status - one of :inherited, :external, :internal, or nil.

Description:
find-symbol locates a symbol whose name is string in a package. If a symbol named string is found in package, directly or by inheritance, the symbol found is returned as the first value; the second value is as follows:

If no such symbol is accessible in package, both values are nil.

Examples:
 (find-symbol "NEVER-BEFORE-USED")   NIL, NIL
 (find-symbol "NEVER-BEFORE-USED")   NIL, NIL
 (intern "NEVER-BEFORE-USED")   NEVER-BEFORE-USED, NIL
 (intern "NEVER-BEFORE-USED")   NEVER-BEFORE-USED, :INTERNAL
 (find-symbol "NEVER-BEFORE-USED")   NEVER-BEFORE-USED, :INTERNAL
 (find-symbol "never-before-used")   NIL, NIL
 (find-symbol "CAR" 'common-lisp-user)   CAR, :INHERITED
 (find-symbol "CAR" 'common-lisp)   CAR, :EXTERNAL
 (find-symbol "NIL" 'common-lisp-user)   NIL, :INHERITED
 (find-symbol "NIL" 'common-lisp)   NIL, :EXTERNAL
 (find-symbol "NIL" (prog1 (make-package "JUST-TESTING" :use '())
                           (intern "NIL" "JUST-TESTING")))
  JUST-TESTING::NIL, :INTERNAL
 (export 'just-testing::nil 'just-testing)
 (find-symbol "NIL" 'just-testing)   JUST-TESTING:NIL, :EXTERNAL
 (find-symbol "NIL" "KEYWORD")
  NIL, NIL
OR:NIL, :EXTERNAL
 (find-symbol (symbol-name :nil) "KEYWORD")  :NIL, :EXTERNAL

Affected By:
intern, import, export, use-package, unintern, unexport, unuse-package

See Also:
intern, find-all-symbols

Notes:
find-symbol is operationally equivalent to intern, except that it never creates a new symbol.

Allegro CL Implementation Details:
None.

Home Previous Up Next Table of Contents Index
© Franz Inc. 1998-2019 - File last updated 02-07-2019