Clojure - find-ns


Advertisements

Finds and returns a particular namespace.

Syntax

Following is the syntax.

(find-ns namespace-name)

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

Return Value − The namespace, if it exists.

Example

Following is an example of find-ns in Clojure.

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

Output

The above program produces the following output.

#object[clojure.lang.Namespace 0x6d3a388c clojure.string]
clojure_namespaces.htm
Advertisements