Browse files

template body can be more than just vectors, so parse accordingly

  • Loading branch information...
pandeiro committed May 8, 2012
1 parent dc21120 commit c454c5b5c845b541cafec449a4c6795b8b261392
Showing with 2 additions and 1 deletion.
  1. +2 −1 src/noir/core.clj
@@ -104,7 +104,8 @@
"Create a function that returns html using hiccup. The function is callable with the given name. Can optionally include a docstring or metadata map, like a normal function declaration."
[fname & args]
(let [[fname params] (macro/name-with-attributes fname args)
- body (rest (filter vector? args))]
+ body (if-let [fv (first (filter vector? args))]
+ (second (split-at (inc (.indexOf args fv)) args)))]
`(defn ~fname ~@params

0 comments on commit c454c5b

Please sign in to comment.