Liking cljdoc? Tell your friends :D
Mostly clj.
Exceptions indicated.

lucid.core.namespace


clear-aliasesclj

(clear-aliases)
(clear-aliases ns)

removes all namespace aliases

;; require clojure.string (require '[clojure.string :as string]) => nil

;; error if a new namespace is set to the same alias (require '[clojure.set :as string]) => (throws) ;; Alias string already exists in namespace

;; clearing all aliases (clear-aliases)

(ns-aliases ns) => {}

;; okay to require (require '[clojure.set :as string]) => nil

removes all namespace aliases

;; require clojure.string
(require '[clojure.string :as string])
=> nil

;; error if a new namespace is set to the same alias
(require '[clojure.set :as string])
=> (throws) ;;  Alias string already exists in namespace

;; clearing all aliases
(clear-aliases)

(ns-aliases *ns*)
=> {}

;; okay to require
(require '[clojure.set :as string])
=> nil
raw docstring

clear-mappingsclj

(clear-mappings)
(clear-mappings ns)

removes all mapped vars in the namespace

;; require join (require '[clojure.string :refer [join]])

;; check that it runs (join ["a" "b" "c"]) => "abc"

;; clear mappings (clear-mappings)

;; the mapped symbol is gone (join ["a" "b" "c"]) => (throws) ;; "Unable to resolve symbol: join in this context"

removes all mapped vars in the namespace

;; require `join`
(require '[clojure.string :refer [join]])
  
;; check that it runs
(join ["a" "b" "c"])
=> "abc"
  
;; clear mappings
(clear-mappings)

;; the mapped symbol is gone
(join ["a" "b" "c"])
=> (throws) ;; "Unable to resolve symbol: join in this context"
raw docstring

runclj/smacro

(run func & args)

runs a function, automatically loading it if not loaded

(ns/run clojure.core/apply + 1 [2 3 4]) => 10

(ns/run wrong-function + 1 [2 3 4]) => :function-not-loaded

runs a function, automatically loading it if not loaded

(ns/run clojure.core/apply + 1 [2 3 4])
=> 10

(ns/run wrong-function + 1 [2 3 4])
=> :function-not-loaded
raw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close