Clojure - alias



Add an alias in the current namespace to another namespace. Arguments are two symbols: the alias to be used and the symbolic name of the target namespace.

Syntax

Following is the syntax.

(alias aliasname namespace-name)

Parameters − ‘aliasname’ is the alias name which needs to be associated with the namespace. ‘namespace-name’ is the namespace which is associated with the running program.

Return Value − None.

Example

Following is an example of alias in Clojure.

(ns clojure.examples.example
   (:require [clojure.set :as set])
   (:gen-class))
(defn example []
   (alias 'string 'clojure.examples.hello))
(example)
clojure_namespaces.htm
Advertisements