Is there a possibility to check if something is a partial function in Clojure?
It would be best to have something like (partial? (partial + 10)) ?
Thanks in advance
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.
No, because functions created by partial are just “normal” functions.
You could however use some metadata for it, like this:
Haven’t really thought through the consequences of this approach though…
Kotarak came up with a nicer solution that works, but not always. For example take this:
This works:
with string/split being the split function from clojure.string (1.3) or clojure.contrib.str-utils2 (1.2).