Skip to content

Instantly share code, notes, and snippets.

@amontalenti
Last active January 1, 2016 08:19
Show Gist options
  • Save amontalenti/8117294 to your computer and use it in GitHub Desktop.
Save amontalenti/8117294 to your computer and use it in GitHub Desktop.
Clojure example of lightweight data modelling
(ns cljtests.data)
(defn main []
(let [some-items [1 2 3 4]
some-mapping {:ST "started", :IP "in progress", :DN "done"}]
(doseq [item some-items]
(println item))
(doseq [[key val] some-mapping]
(println (str key " => " val)))))
(defn -main
[& args]
(main))
@jpfuentes2
Copy link

Nice, that example is certainly more symmetrical. Minor suggestion:

Place all trailing parentheses on a single line instead of distinct lines.

From https://github.com/bbatsov/clojure-style-guide

@amontalenti
Copy link
Author

Thanks! Updated to reflect that style consistency.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment