I’m trying to use Clojure’s update-in function but I can’t seem to understand why I need to pass in a function?
I’m trying to use Clojure’s update-in function but I can’t seem to understand why
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.
update-intakes a function, so you can update a value at a given position depending on the old value more concisely. For example instead of:you can write:
Of course if the new value does not depend on the old value,
assoc-inis sufficient and you don’t need to useupdate-in.