practicalli / clojure

Practicalli Clojure REPL Driven Development
https://practical.li/clojure/
Creative Commons Attribution Share Alike 4.0 International
89 stars 36 forks source link

loop and recur #188

Open practicalli-johnny opened 4 years ago

practicalli-johnny commented 4 years ago

https://www.freecodecamp.org/forum/t/clojure-loop-recur/18418

Bost commented 3 years ago

It looks like there are better ways:

;; separation of collection-creation from -reduction unlocks quite a few "new" abilities. E.g. inspection: (reductions * (range 1 (inc 5)))


* Parallel version of the functional implementation: https://youtu.be/GvJm-eJ5o18?t=1617 (what a performance gain!)

* And absolutely mind-boggling is the https://youtu.be/GvJm-eJ5o18?t=2242
I always felt like logic programming is the real way how we should use and program our computers! It's just that I can't really get my mind set up for it, so I always end up programming things the usual way. (At least I transitioned from object-oriented & imperative to functional style. Maybe one day, hopefully...)