Clojure - ns-aliases


Advertisements

Returns the aliases, which are associated with any namespaces.

Syntax

Following is the syntax.

(ns-aliases namespace-name)

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

Return Value − Returns the aliases which are associated with any namespaces.

Example

Following is an example of ns-aliases in Clojure.

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

Output

The above program produces the following output.

{jio #object[clojure.lang.Namespace 0x2fd1433e clojure.java.io]}
clojure_namespaces.htm
Advertisements