Share
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.
orThe function
some“Returns the first logical true value of (pred x) for any x in coll, else nil.”So you could use
(some identity coll)foror. Note that its behaviour will differ fromorwhen the last value isfalse: it will returnnilwhereorwould returnfalse.andIf you don’t need to know the value of the last form in the
collvector, you can use(every? identity coll)forand. This will differ from the behaviour of theandmacro in that it returnstrueif all of its arguments are truthy. See larsmans’ answer if you need the result of the last form.