Clojure find-ns

2018-12-22 14:28 更新

查找并返回特定的命名空間。

語法

以下是  find-ns 的基本使用語法:

(find-ns namespace-name)

參數(shù)? 'namespace-name'是需要找到的命名空間。

返回值 ? 命名空間(如果存在)。

下面是 find-ns 的使用示例:

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

輸出

以上示例將輸出以下結(jié)果:

#object[clojure.lang.Namespace 0x6d3a388c clojure.string]
以上內(nèi)容是否對您有幫助:
在線筆記
App下載
App下載

掃描二維碼

下載編程獅App

公眾號
微信公眾號

編程獅公眾號