Skip to content

Instantly share code, notes, and snippets.

@alexott
Created August 27, 2010 08:15
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 alexott/553031 to your computer and use it in GitHub Desktop.
Save alexott/553031 to your computer and use it in GitHub Desktop.
;; use of defrecords for https://jukkaz.wordpress.com/2010/08/26/age-discrimination-with-clojure/
(defrecord Person [name age])
(def persons1
[(Person. "Boris" 40)
(Person. "Betty" 32)
(Person. "Bambi" 17)])
(let [[minors majors] (separate #(<= (:age %) 18) persons1)]
(println minors)
(println majors))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment