No, unfold not implemented in Clojure. It is provided by the amalloys flatland.useful library, which is widely used according to CrossClj. Having seen that the blog post that you linked provides a rather in-depth study of the subject, I suspect that your question has more questions than the direct answer can satisfy ... Do you have any scenario in which iterate inadequate? Or disappointed that iterate not completely unfold by name or behavior?
(defn fib-step [[ab]] [b (+ ab)]) (take 10 (map first (iterate fib-step [0 1]))) (take-while (complement neg?) (iterate dec 5))
I prefer to use iterate for these examples because iterate already part of the kernel. I see that people prefer unfold if they are more familiar to them.
There are many libraries that provide "things that should have been in the kernel", such as https://weavejester.imtqy.com/medley/medley.core.html . A quick search on https://crossclj.info/ shows https://github.com/amalloy/useful contains flatland.useful.seq / unfold, which, although I havenβt used it, looks like a great implementation of the main Clojure contributor and comes with some other cool materials to download.
source share