 (def ^{:tag `Configuration} ig
   "Alias for `configuration`."
   configuration)
+
+(defn clone
+  "Return new Hadoop `Configuration`, cloning `conf`."
+  [conf] (Configuration. (configuration conf)))
+
+(defmacro with-default
+  "Set new default configuration `conf` within the dynamic scope of
+the `body` expressions."
+  [conf & body]
+  `(binding [*default* (clone ~conf)]
+     ~@body))
 
 (defn get
   "Get string value of `conf` parameter `key`"

(defn configuration
  "Extract or produce a Hadoop `Configuration`.  If provided a `conf`
argument, coerce it to be a `Configuration` which if possible shares
mutable state with that original argument."
  {:tag `Configuration}
  ([] (Configuration.))
  ([conf] (configuration* conf)))

(def ^{:tag `Configuration} iguration

  "Merge key-value pairs `kvs` into Hadoop configuration `conf`."
  [conf & kvs] (merge! conf (partition 2 kvs)))

(defmethod configuration* Configuration [conf] conf)
(defmethod configuration* Configurable
  [cable] (.getConf ^Configurable cable))
