Permalink
Browse files

Compile rules at runtime

  • Loading branch information...
1 parent 665fbc2 commit 61c5f27f139b2b8bf739ed2bb611b86098432df7 @jonase committed Mar 11, 2013
Showing with 5 additions and 5 deletions.
  1. +5 −5 src/kibit/rules/util.clj
View
10 src/kibit/rules/util.clj
@@ -10,8 +10,8 @@
(not (vector? rule)))
(defmacro defrules [name & rules]
- (let [rules (for [rule rules]
- (if (raw-rule? rule)
- rule ;; raw rule, no need to compile
- (compile-rule rule)))]
- (list 'def name (vec rules))))
+ `(let [rules# (for [rule# '~rules]
+ (if (raw-rule? rule#)
+ rule# ;; raw rule, no need to compile
+ (compile-rule rule#)))]
+ (def ~name (vec rules#))))

0 comments on commit 61c5f27

Please sign in to comment.