Record of experiments, readings, links, videos and other things that I find on the long road.
Registro de experimentos, lecturas, links, vídeos y otras cosas que voy encontrando en el largo camino.
Why it is so complicated? (defn say [n] (let [append #(cond-> %1 (divisible-by? %2 n) (str %3))] (-> nil (append 3 "Fizz") (append 3 "Buzz") (append 3 "Bang") (or (str n)))))
I constrained myself to only use cond-> in order to learn more about it. Of course, using other features of the languages makes it much simpler.Thank you very much for your feedback.
My fizzbuzz with density level over 9000 :)(defn fizzbuzz [n](letfn [(x [d v] (if (= (mod n d) 0) v ""))](join "" [(x 3 "Fizz") (x 5 "Buzz")])))To run(map fizzbuzz (range 1 100))
Nice solution!Some time ago, I did it with the constraint of not using conditionals (if, cond, etc.) and I got this:Kata: FizzBuzz with no conditionals in Clojurehttp://garajeando.blogspot.com.es/2014/11/kata-fizzbuzz-with-no-conditionals-in.htmlThanks a lot for commenting.
Nice !Thanks !
Did you consider showing your code in a live environment with KLIPSE:See: http://bit.ly/1S9YTbH
I'll have a look at it.Thanks Yeonathan
Hi Manuel,Did you take a look at KLIPSE? Would you like to have a POC for KLIPSE on your blog?
Your can reach me on twitter @viebel
Remember that the `cond->` macro automatically adds the argument in as the first arg for you, so all the lines that look like `(#(str % "Fizz")` can be replaced with just `(str "Fizz")` for the exact same functionality
Thank you very much Ryan!You're totally right.I changed the code as you say.Best regards