I am processing a sequence in clojure. I would like to retrieve elements until a predicate function is true. How do I do that?
You can use take-while
along with not
user=> (take-while (comp not even?) [3 9 2 4 6 10 1 2])
(3 9)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With