Skip to content

Commit

Permalink
Bindings can be omitted from eval
Browse files Browse the repository at this point in the history
  • Loading branch information
weavejester committed Mar 9, 2011
1 parent cbb4dc4 commit 6a17f0b
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/comb/template.clj
Expand Up @@ -54,7 +54,9 @@
(defn eval
"Evaluate a template using the supplied bindings. The template source may
be a string, or an I/O source such as a File, Reader or InputStream."
[source bindings]
(let [keys (map (comp symbol name) (keys bindings))
func (compile-fn [{:keys keys}] source)]
(func bindings)))
([source]
(eval source {}))
([source bindings]
(let [keys (map (comp symbol name) (keys bindings))
func (compile-fn [{:keys keys}] source)]
(func bindings))))

0 comments on commit 6a17f0b

Please sign in to comment.