Skip to content

Instantly share code, notes, and snippets.

@calebphillips
Last active December 12, 2015 05:39
Show Gist options
  • Save calebphillips/4723563 to your computer and use it in GitHub Desktop.
Save calebphillips/4723563 to your computer and use it in GitHub Desktop.
;; Find a random even number less than 100
;; Standard nested lisp form
(rand-nth (filter even? (range 100)))
;; With threading macro http://clojuredocs.org/clojure_core/clojure.core/-%3E%3E
(->> (range 100)
(filter even?)
rand-nth)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment