about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAlan Pearce2014-09-23 21:41:36 +0100
committerAlan Pearce2014-09-23 21:41:36 +0100
commit388a6a07086c4217a907a8643b27693618c008f2 (patch)
tree3bd888c468147774cc58ec6c20c48e5caeabd10f
parent648699e0c15773bc332b2876ad0aa21c897e3654 (diff)
downloadmicroformats-388a6a07086c4217a907a8643b27693618c008f2.tar.lz
microformats-388a6a07086c4217a907a8643b27693618c008f2.tar.zst
microformats-388a6a07086c4217a907a8643b27693618c008f2.zip
cond-let: use % instead of x as anaphor
-rw-r--r--src/microformats/parser.clj10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/microformats/parser.clj b/src/microformats/parser.clj
index 875caec..f348f3b 100644
--- a/src/microformats/parser.clj
+++ b/src/microformats/parser.clj
@@ -6,7 +6,7 @@
 (defmacro cond-let
   [& clauses]
   (when clauses
-    (list 'if-let ['x (first clauses)]
+    (list 'if-let ['% (first clauses)]
           (if (next clauses)
             (second clauses)
             (throw (IllegalArgumentException.
@@ -179,13 +179,13 @@
     :img (-> element :attrs :alt)
     (cond-let
      (first (html/select element [html/root :> [:img html/only-child]]))
-     (-> x :attrs :alt)
+     (-> % :attrs :alt)
      (first (html/select element [html/root :> [:abbr html/only-child (html/attr? :title)]]))
-     (-> x :attrs :title)
+     (-> % :attrs :title)
      (first (html/select element [html/root :> html/only-child :> [:img html/only-child]]))
-     (-> x :attrs :alt)
+     (-> % :attrs :alt)
      (first (html/select element [html/root :> html/only-child :> [:abbr html/only-child (html/attr? :title)]]))
-     (-> x :attrs :title)
+     (-> % :attrs :title)
      true (node-to-text (:content element)))))
 
 (defn- imply-url