Skip to content

Instantly share code, notes, and snippets.

@titonbarua
Created November 17, 2017 13:33
Show Gist options
  • Save titonbarua/79ba4fe3f8e556cfdf4111c8d6b2b901 to your computer and use it in GitHub Desktop.
Save titonbarua/79ba4fe3f8e556cfdf4111c8d6b2b901 to your computer and use it in GitHub Desktop.
Cascaded map+filter operations to transform a sequence of data in clojure
(filter
;; The filtering function.
(fn [x] (<= 0 x 100))
;; The sequence to be filtered.
(map
;; The mapping function.
(fn [x] (* x 3))
;; The sequence to be mapped.
(filter
;; The filtering function.
odd?
;; The sequence to be filtered.
(range -100 100))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment