Liking cljdoc? Tell your friends :D

zensols.actioncli.ns

Useful namespace macros.

Some macros taken from clojure/clojure-contrib.

Useful namespace macros.

Some macros taken from
[clojure/clojure-contrib](https://clojure.github.io/clojure-contrib/with-ns-api.html).
raw docstring

with-context-nscljmacro

(with-context-ns var [attr-map? references*] exprs*)

Just like with-ns but brings in a context into the temporary namespace.

The var parameter is the variable to pass to the temporary namespace.

Example

(let [abind 'someval]
  (with-context-ns
      abind
      [(:require [clojure.string :as s])]
    (s/capitalize (str (name abind)))))

See [[clojure.core/ns]].

Just like [[with-ns]] but brings in a context into the temporary namespace.

The **var** parameter is the variable to pass to the temporary namespace.

## Example

```
(let [abind 'someval]
  (with-context-ns
      abind
      [(:require [clojure.string :as s])]
    (s/capitalize (str (name abind)))))
```

See [[clojure.core/ns]].
raw docstring

with-nscljmacro

(with-ns [attr-map? references*] exprs*)

Just like with-temp-ns but allows an [[clojure.core/ns]] specification (not including the namespace name).

Example

(with-ns
  [(:require [clojure.string :as s])]
  (s/capitalize "here"))

See [[clojure.core/ns]].

Just like [[with-temp-ns]] but allows an [[clojure.core/ns]]
specification (not including the namespace name).

## Example

```
(with-ns
  [(:require [clojure.string :as s])]
  (s/capitalize "here"))
```

See [[clojure.core/ns]].
raw docstring

with-other-nscljmacro

(with-other-ns ns & body)

Evaluates body in another namespace. ns is either a namespace object or a symbol. This makes it possible to define functions in namespaces other than the current one.

Evaluates body in another namespace.  ns is either a namespace
object or a symbol.  This makes it possible to define functions in
namespaces other than the current one.
raw docstring

with-temp-nscljmacro

(with-temp-ns & body)

Evaluates body in an anonymous namespace, which is then immediately removed. The temporary namespace will 'refer' clojure.core.

Evaluates body in an anonymous namespace, which is then immediately
removed.  The temporary namespace will 'refer' clojure.core.
raw docstring

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

× close