What are clojure special shapes?

As part of the Cider debugger improvement, I need to implement special handling for all possible special forms. For words, do I need to know all the characters that satisfy special-symbol? . The doc page on special forms , although useful, does not offer all of them.

For example, after some experiments, I found out that

  • Most of the forms listed there have * (for example, let* and loop* ).
  • There is a special symbol clojure.core/import* (which I would not have found if it werenโ€™t for just happiness).

Is there a complete list of all special characters? Also, is there a way to list all interned characters? If so, could I filter for more special-symbol? .

+7
symbols clojure
source share
1 answer

Looking for a special-symbol? definition special-symbol? , you will get a big key:

 (defn special-symbol? "Returns true if s names a 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* finally loop* do letfn* if clojure.core/import* new deftype* let* fn* recur set! . var quote catch throw monitor-enter def) 
+14
source share

All Articles