Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@ray1729
Created June 11, 2013 09:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ray1729/5755484 to your computer and use it in GitHub Desktop.
Save ray1729/5755484 to your computer and use it in GitHub Desktop.
Find 4-9 letter words in a file.
(defn filter-file [filename]
  (with-open [rdr (io/reader filename)]
    (reduce (fn [words line]
              (into words (filter #(<= 4 (count %) 9) (str/split line #"\s+"))))
            #{}
            (line-seq rdr))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment