diff options
author | Alan Pearce | 2014-09-28 13:08:02 +0100 |
---|---|---|
committer | Alan Pearce | 2014-09-28 13:08:02 +0100 |
commit | 71be658b093da8be2fb99997cdc961b1246a4ee3 (patch) | |
tree | 4e2370b439dc3387019d111a583a1d366d311f64 /src | |
parent | b702d4ca7f3eb140a5436469e3bc05d997b1bb26 (diff) | |
download | microformats-71be658b093da8be2fb99997cdc961b1246a4ee3.tar.lz microformats-71be658b093da8be2fb99997cdc961b1246a4ee3.tar.zst microformats-71be658b093da8be2fb99997cdc961b1246a4ee3.zip |
Minor renaming
Diffstat (limited to 'src')
-rw-r--r-- | src/microformats/parser.clj | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/microformats/parser.clj b/src/microformats/parser.clj index 8bc7c3c..e3de0a1 100644 --- a/src/microformats/parser.clj +++ b/src/microformats/parser.clj @@ -4,18 +4,17 @@ [clojure.core.reducers :as r] [clojure.string :as str])) -(defmacro cond-let +(defmacro anacond [& clauses] (when clauses (list 'if-let ['% (first clauses)] (if (next clauses) (second clauses) (throw (IllegalArgumentException. - "cond-let requires an even number of forms"))) - (cons 'cond-let (next (next clauses)))))) + "anacond requires an even number of forms"))) + (cons 'anacond (next (next clauses)))))) -(defn mf-names-from-class - "Get microformat classnames from a class attribute" +(defn prefixed-by? [prefix] #(.startsWith % prefix)) @@ -34,7 +33,7 @@ [prefix] (comp (r/map keyword) (r/map (remove-mf-prefix prefix)) - (r/filter (mf-names-from-class prefix)))) + (r/filter (prefixed-by? prefix)))) (defn element-to-classes "Get list of classes from an element" @@ -169,7 +168,7 @@ [element] (->> element element-to-classes - (r/filter (mf-names-from-class "h-")) + (r/filter (prefixed-by? "h-")) (into []))) (defn- parse-implied-name |