Does something similar to this exist?:
(deftest fantasy
(is (= ["let" "def" "ns" "etc."] clojure.core/special-chars)))
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.
I don’t think there’s a good way to do it.
But here’s a hack (run on a bleeding-edge 1.2 snapshot):
This is relying on implementation details of the compiler. Please don’t use this in production code.
Note that
letis considered a special form, even though it’s really a normal macro andlet*is the actual special form. Same withfnand others. These are probably implementation details, subject to change in the future.So if you really want a list of special forms, I’d suggest typing the list yourself. The list is short enough (everything listed on http://clojure.org/special_forms). Look at the source for
clojure.core/special-form-anchor, there’s a hard-coded list there to copy/paste. (Again probably an implementation detail not to be relied upon though.)And there’s also this: