From 54c6a5dec031de59dad385d4ba2ccda09a70ec2a Mon Sep 17 00:00:00 2001 From: Carlo Zancanaro Date: Thu, 20 Jun 2013 15:49:55 +1000 Subject: Fix compiling of n-ary operators (0 & 1 args), add operator aliases n-ary operators with no arguments would break everything (compiling to "()"). This should no longer be the case. Additionally, unary operators (ie. negation) now compile properly in the one arg case. Operator aliases allow us to change how we refer to things like the "~" regex operator in postgresql. At the moment it's aliased as "$". Additionally: booleans now compile to upper case. --- src/clojure_sql/writer.clj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/clojure_sql/writer.clj') diff --git a/src/clojure_sql/writer.clj b/src/clojure_sql/writer.clj index 5f4250b..176cc67 100644 --- a/src/clojure_sql/writer.clj +++ b/src/clojure_sql/writer.clj @@ -53,7 +53,7 @@ (if (= (first args) :let) `(let ~(second args) ~(apply do-m* (nnext args)))) - (if (= (name (second args)) "<-") + (if (every? #(% (second args)) [symbol? #(= (name %) "<-")]) (let [[var <- val & others] args] `(bind ~val (fn [~var] -- cgit v1.2.3