Permalink
Browse files

Fix handling of (), empty list

  • Loading branch information...
1 parent f194cb1 commit 33c5b5a3e88949b50d8583f6cc6e7be0d380c9b4 @brandonbloom committed Feb 20, 2013
Showing with 3 additions and 3 deletions.
  1. +1 −1 src/backtick.clj
  2. +2 −2 test/backtick_test.clj
View
2 src/backtick.clj
@@ -42,7 +42,7 @@
(vector? form) `(vec ~cat)
(map? form) `(apply hash-map ~cat)
(set? form) `(set ~cat)
- (seq? form) `(list* ~cat)
+ (seq? form) `(apply list ~cat)
:else (throw (Exception. "Unknown collection type"))))
:else `'~form))
View
4 test/backtick_test.clj
@@ -6,8 +6,8 @@
(testing "Primitives, collections, unquote, and splice; symbols qualified"
(let [n 5 v [:a :b]]
- (is (= `(5 nil true a/b ~n [p/q ~@v r/s] {:x #{"s"}})
- (template (5 nil true a/b ~n [p/q ~@v r/s] {:x #{"s"}}))))))
+ (is (= `(5 nil () true a/b ~n [p/q ~@v r/s] {:x #{"s"}})
+ (template (5 nil () true a/b ~n [p/q ~@v r/s] {:x #{"s"}}))))))
(testing "Automatic gensyms"
(let [[a b c d] (template [foo# bar# foo# bar])]

1 comment on commit 33c5b5a

@cemerick

Works great, thanks for the quick fix. :-)

Please sign in to comment.