Browse files

simplify how params and body are bound

  • Loading branch information...
1 parent c454c5b commit 59e4a9c8c3ca19737ddf8ad065f5c453c90218c6 @pandeiro committed May 10, 2012
Showing with 4 additions and 4 deletions.
  1. +4 −4 src/noir/core.clj
@@ -103,10 +103,10 @@
(defmacro defpartial
"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 (if-let [fv (first (filter vector? args))]
- (second (split-at (inc (.indexOf args fv)) args)))]
- `(defn ~fname ~@params
+ (let [[fname args] (macro/name-with-attributes fname args)
+ params (first args)
+ body (rest args)]
+ `(defn ~fname ~params

0 comments on commit 59e4a9c

Please sign in to comment.