Utilities for resolving and loading namespaces.
Operations are parallel wherever it makes sense and it's safe to do so; efficiency matters particularly for large projects/classpaths.
Utilities for resolving and loading namespaces. Operations are parallel wherever it makes sense and it's safe to do so; efficiency matters particularly for large projects/classpaths.
(canonical-source ns)
Returns the URL of the source file for the namespace object or symbol, according to the canonical naming convention, if present on the classpath.
Returns the URL of the source file for the namespace object or symbol, according to the canonical naming convention, if present on the classpath.
(classpath-namespaces)
(classpath-namespaces classpath-urls)
(classpath-namespaces classpath-urls extract-fn)
Returns all namespaces (by default: of .clj or .cljc extension) defined in sources on the classpath or the specified classpath URLs.
Returns all namespaces (by default: of .clj or .cljc extension) defined in sources on the classpath or the specified classpath URLs.
(ensure-namespace ns)
Renamed - please use #'ensure-namespace!
instead.
Renamed - please use `#'ensure-namespace!` instead.
(ensure-namespace! ns)
Require ns
(no-op if already loaded). Return the symbol if successful,
and nil
if this fails.
Require `ns` (no-op if already loaded). Return the symbol if successful, and `nil` if this fails.
(has-tests? ns)
Returns a truthy value if the namespace has any vars with :test
metadata.
Returns a truthy value if the namespace has any vars with `:test` metadata.
(in-project? url)
Whether the URL is in the current project's directory.
Whether the URL is in the current project's directory.
(inlined-dependency? namespace)
Returns true if the namespace matches one of our, or eastwood's, inlined dependencies.
Returns true if the namespace matches one of our, or eastwood's, inlined dependencies.
(internal-namespace? namespace & [prefixes])
Returns true if the namespace matches the given prefixes.
Returns true if the namespace matches the given prefixes.
(jvm-clojure-resource-name->ns-form resource-name)
Given a .clj or .cljc resource-name
, returns its ns
form.
Given a .clj or .cljc `resource-name`, returns its `ns` form.
(jvm-clojure-resource-name->ns-name resource-name)
Given a .clj or .cljc resource-name
, returns its namespace name.
Given a .clj or .cljc `resource-name`, returns its namespace name.
(load-project-namespaces)
Require and return all namespaces validly defined in the current project.
Require and return all namespaces validly defined in the current project.
(loaded-namespaces & [filter-regexps])
Returns all loaded namespaces, except those coming from inlined dependencies.
filter-regexps
is used to filter out namespaces matching regexps.
Returns all loaded namespaces, except those coming from inlined dependencies. `filter-regexps` is used to filter out namespaces matching regexps.
(loaded-project-namespaces)
Return all loaded namespaces defined in the current project.
Return all loaded namespaces defined in the current project.
(ns-form-imports ns-form)
Given a ns
form, returns its :imports
as fully-qualified Java class names,
expressed as symbols.
Prefix notation is undone, so that all returned members are simple symbols that can be resolved to a class directly.
Given a `ns` form, returns its `:imports` as fully-qualified Java class names, expressed as symbols. Prefix notation is undone, so that all returned members are simple symbols that can be resolved to a class directly.
(project-namespaces)
Returns all JVM Clojure namespaces defined in sources within the current project.
Returns all JVM Clojure namespaces defined in sources within the current project.
(project-ns-forms)
Returns all JVM Clojure ns
forms defined in sources within the current project,
indexed by ns-name
.
Returns all JVM Clojure `ns` forms defined in sources within the current project, indexed by `ns-name`.
(read-namespace url)
Returns the namespace name from the first top-level ns
form in the file.
Returns the namespace name from the first top-level `ns` form in the file.
(read-ns-form url)
Returns the first top-level ns
form in the file.
Returns the first top-level `ns` form in the file.
(read-ns-name url)
Returns the namespace name from the first top-level ns
form in the file.
Returns the namespace name from the first top-level `ns` form in the file.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close