Clojure: is `fn` a special-symbol, a macro or a special form?
clojure
Solution
Other examples are
let let*
letfn letfn*
loop loop*
The starred versions are truly special symbols at the compiler level, primitives of the language. The non-starred versions are `var`s defined within Clojure. These are helpers to the lower level starred versions that do things like destructuring, argument checking, and documentation at a more convenient level, i.e. in Clojure.
Clojure's documentation defines special forms rather strictly as "primitives built-in to Clojure that perform core operations". But this is really meant to less strictly apply to their non-starred helpers when applicable as in the documentation's list of special forms.
This is just semantics. In other places, other lisps, you'll see special form used to talk about any form that alters the normal rules of evaluation. So in that sense, you'd call the macro `and` a special form as it does short-circuit evaluation. In Clojure `and` is not tagged or documented as such, which is consistent with reserving the term for primitives or their helpers.
Problem
The doc says that it's a special form, although I see that it's defined as a macro. Also `(meta #'fn)` has both `:macro` and `:special-form` as true. Finally, `(special-symbol? 'fn)` is `false` although `(special-symbol? 'fn*)` is `true`. Can someone clear this up for me? Are there any other weird symbols in Clojure that are both special-form and macro and not special-symbol? And one more thing, it's the only callable symbol that I've seen so far that has this `(meta #'fn)`: ``` {:arglists ([& sigs]), :forms [(fn name? [params*] exprs*) (fn name? ([params*] exprs*) +)]...} ``` So the arg list isn't in `:arglists` like other symbols, but in `:forms`. Any other symbols like this in Clojure?