symbols - What are all of clojure's special forms? -
as part of improving cider's debugger, need implement special handling possible special-forms. in order words, need know symbols satisfy special-symbol?
. doc page on special forms, while helpful, doesn't offer of them.
for instance, after experimentation, i've learned that
- most of forms listed there have
*
counterpart (let*
,loop*
, instance). - there
clojure.core/import*
special-symbol (which wouldn't have found if not sheer luck).
is there complete list of special symbols?
alternatively, there way list interned symbols? if so, filter on special-symbol?
.
looking @ definition of special-symbol?
provides big clue:
(defn special-symbol? "returns true if s names special form" {:added "1.0" :static true} [s] (contains? (. clojure.lang.compiler specials) s))
thus:
user=> (pprint (keys (. clojure.lang.compiler specials))) (& monitor-exit case* try reify* loop* letfn* if clojure.core/import* new deftype* let* fn* recur set! . var quote catch throw monitor-enter def)
Comments
Post a Comment