Skip to content

clojure.core/namespace

View this page on ClojureDocs

Type: function Added: Clojure 1.0 Examples: 2 Runnable: 1
([x])

Returns the namespace String of a symbol or keyword, or nil if not present.

Examples

by Miles on . May have evaluation errors.
by dominem on

Note by merriam

Note this does not try to be "smart"

user=>(namespace 'no-such-name/no-such-var)
"no-such-name"

user=>(def a-var)
#'user-a-var

user=>(namespace 'a-var)
nil

See also


Content from the matching ClojureDocs page, with authors credited on each contribution.