Clojure – ns-aliases

Clojure ns-aliases

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

Next Topic : Click Here

This Post Has 2 Comments

Leave a Reply