Clojure – find-ns

Clojure find-ns

In this guide, we will discuss Clojure find-ns. 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]

Next Topic : Click Here

This Post Has 2 Comments

Leave a Reply