I have seen the clojure symbol -> used in many places, but I am unsure as to what this symbol is called and does, or even whether it is part of standard clojure. Could someone explain this to me?
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.
-> uses the result of a function call and send it, in sequence, to the next function call.
So, the easier example would be:
Returns 5, because it sends 2, to the next function call (+ 3)
Building up on this,
Returns -2. We keep the result of the first call, (+ 3) and send it to the second call (- 7).
As noted by @bending, the accepted answer would have been better showing the doto macro.