Relative Content

Tag Archive for clojure

Filter into two different collections

(let [ truthys (filter #(filter-func %) coll) falsys (filter #(not filter-func %) coll)] This code traverves coll twice and applys filter-func twice to each element. I was wondering, is there a way to filter coll into both truthys and falsys in just one go? clojure 1 (let [{truhys true, falsys false} (group-by filter-func coll)] …) […]

Filter into two different collections

(let [ truthys (filter #(filter-func %) coll) falsys (filter #(not filter-func %) coll)] This code traverves coll twice and applys filter-func twice to each element. I was wondering, is there a way to filter coll into both truthys and falsys in just one go? clojure 1 (let [{truhys true, falsys false} (group-by filter-func coll)] …) […]

Clojure state and persistence

I’m learning Clojure to see if it’s something I can leverage at my current job, and more importantly, how I can convince my bosses that Clojure has a ‘killer feature’ over java that makes it worth the investment1.

What limitations does the JVM impose on tail-call optimization

Clojure does not perform tail call optimization on its own: when you have a tail recursive function and you want to have it optimized, you have to use the special form recur. Similarly, if you have two mutually recursive functions, you can optimize them only by using trampoline.

Understanding clojure keywords

I’m taking my first steps with Clojure. Otherwise, I’m somewhat competent with JavaScript, Python, Java, and a little C.