Skip to content

Instantly share code, notes, and snippets.

@kasz
Created March 1, 2012 15:01
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 kasz/1950304 to your computer and use it in GitHub Desktop.
Save kasz/1950304 to your computer and use it in GitHub Desktop.
Typed and standard Clojure functions
(defn- list-directory-json-files
"Lists JSON files in specified directory."
[path]
(let [directory (io/file path)
files (file-seq directory)]
(filter #(.endsWith %1 ".json") (map #(.getPath %1) files))))
(defn- list-directory-json-files
"Lists JSON files in specified directory."
[^String path]
(let [directory (io/file path)
files (file-seq directory)]
(filter #(.endsWith ^String %1 ".json") (map #(.getPath ^java.io.File %1) files))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment