 (ns template.core)
+
+(defn- default-ops {'entry-set (fn [my-map] (mapv (fn [[k v]] {:k k :v v}) (sorted-map my-map)))})
 
 (defn- resolve-tpl [op-map data out-data tpl]
   (cond

    (list? tpl) (let [[op & args] tpl]
                  (cond
                    (map? op) (let [[label col] (first op)
                                    col (data col)
                                    results (reduce (fn [out elem]
                                                      (let [new-data (if (map? elem)
                                                                       (reduce (fn [obj [k v]]

(defn build-template-factory [op-map]
  (fn build-template [tpl]
    (fn resolve-template [data]
      (resolve-tpl (merge op-map default-ops) data [] tpl))))
