Are there built in functions in Clojure similar to Python’s any and all functions?
For example, in Python, it’s all([True, 1, 'non-empty string']) == True.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
(every? f data)[docs] is the same asall(f(x) for x in data).(some f data)[docs] is likeany(f(x) for x in data)except that it returns the value off(x)(which must be truthy), instead of justtrue.If you want the exact same behaviour as in Python, you can use the
identityfunction, which will just return its argument (equivalent to(fn [x] x)).