clojure map transformation with Input values from sequence
Need Help in transforming data from map using a function
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)] …) […]
Create lists from columns
I have data in a text file formatted like this:
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
.
For csv database extracts, how do map keys not create a dependency?
A lot of my work is done with .csv extracts (reports) from databases. As I have been programming in Clojure, I’ve received comments that relying on vector indexes creates dependencies. I understand why, and concur.
Does Clojure have continuations/coroutines/etc?
I started programming with Python, and I was really confused by concepts like coroutines and closures.
What does using (vec col) or (vector arg1 & args) cost?
I am working through some Lisp exercises using Clojure. If I were to convert Lisp lists to Clojure vectors, solving some of the problems would be simpler, so here is my question:
Understanding clojure keywords
I’m taking my first steps with Clojure. Otherwise, I’m somewhat competent with JavaScript, Python, Java, and a little C.