Does something similar to this exist?:
(deftest fantasy
(is (= ["let" "def" "ns" "etc."] clojure.core/special-chars)))
Does something similar to this exist?:
(deftest fantasy
(is (= ["let" "def" "ns" "etc."] clojure.core/special-chars)))
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: