Macro
Repeatedly evaluates template expr (in a do block) using values in args. args are grouped by the number of holes in the template. Example: (do-template (check _1 _2) :a :b :c :d) expands to (do (check :a :b) (check :c :d))
; clojure/contrib/template.clj:184 (defmacro do-template [expr & args] (when-not (template? expr) (throw (IllegalArgumentException. (str (pr-str expr) " is not a valid template.")))) (let [expr (postwalk-replace {'_ '_1} expr) argcount (count (find-holes expr))] `(do ~@(map (fn [a] (apply-template expr a)) (partition argcount args)))))
Copyright (c) Rich Hickey. All rights reserved.
The use and distribution terms for this software are covered by the Eclipse Public License 1.0, which can be found in the file epl-v10.html at the root of this distribution. By using this software in any fashion, you are agreeing to be bound by the terms of this license. You must not remove this notice, or any other, from this software.