资 源 简 介
A typical situation in a Clojure project is that several namespaces start with the same combination of use-require-import, or at least have much of these references to the outside world in common. However, Clojure currently has no way to define a combination of external references once and then re-use and extend it in individual namespaces.
Nstools is an attempt to provide a solution: it permits any namespace to serve as a template for constructing other namespaces. An enhanced version of the ns macro adds the clauses "like", "clone" and "remove". Suppose you have a namespace foo that serves as the template:
(ns foo (:use [clojure.contrib.monads :exclude (cont-m)]) (:require [clojure.contrib.seq :as su]) (:import (java.io InputStream)))
You can then create a namespace bar and make it "like foo". This takes over all the references created by the use, require, and import clauses in