Clojure - ns-name


Advertisements

Returns the name of a particular namespace.

Syntax

Following is the syntax.

(ns-name namespace-name)

Parameters − ‘namespace-name’ is the namespace which needs to be found.

Return Value − The actual name of the namespace.

Example

Following is an example of ns-name in Clojure.

(ns clojure.examples.example
   (:require [clojure.set :as set])
   (:gen-class))
(defn example []
   (println (ns-name 'clojure.string)))
(example)

Output

The above program produces the following output.

clojure.string
clojure_namespaces.htm
Advertisements