Permalink
Browse files

Bindings can be omitted from eval

  • Loading branch information...
1 parent cbb4dc4 commit 6a17f0b3c7b3571f60f7838de50d6aae91fdf23b @weavejester committed Mar 9, 2011
Showing with 6 additions and 4 deletions.
  1. +6 −4 src/comb/template.clj
View
@@ -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.