Created
November 13, 2017 23:25
-
-
Save matheusazzi/eb53bcdd760b7ce78e506460c39a0f86 to your computer and use it in GitHub Desktop.
example.clj
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(def tags ["1.0.0" "1.0.1" "1.0.2" "1.1.0" "1.1.2" "1.2.2"]) | |
(defn remove-dots [tag] | |
(clojure.string/replace tag "." "")) | |
(defn to-int [s] | |
(Integer/parseInt s)) | |
(defn between-versions? [n] | |
(and (> n 101) (< n 120))) | |
(->> tags | |
(map remove-dots) | |
(map to-int) | |
(filter between-versions?)) | |
; or | |
; (->> tags | |
; (map (comp to-int remove-dots)) | |
; (filter between-versions?)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment