On Mon, Feb 2, 2009 at 9:28 PM, Mark Volkmann <r.mark.volkm...@gmail.com> wrote: > > I understand that special forms are all recognized by the Clojure > compiler clojure.lang.Compiler. Is it the case that all function and > macro definitions can be found in some .clj file, whether supplied > with Clojure or not? Asked another way, are there any functions or > macros that are included with Clojure that are implemented entirely in > Java code?
There are a very few functions and a few more vars defined only in Java code, but that participate in namespaces the normal way and therefore don't count as special forms. One way to find these is to get a list of all the clojure.core vars that have no :file metadata: (filter #(nil? (:file (meta %))) (vals (ns-publics 'clojure.core))) These are the functions: load-file in-ns identical? Note that even though 'in-ns' and 'ns' are not special forms, they are handled specially in the resolver so you never need to give the namespace using them. The other documented vars are: *agent* *command-line-args* *compile-files* *compile-path* *err* *file* *flush-on-newline* *in* *ns* *out* *print-dup* *print-meta* *print-readably* *warn-on-reflection* What the remaining vars do is a mystery for all but those willing to plumb the depths of Clojure's Java sources: *macro-meta* *math-context* *use-context-classloader* All (or nearly?) of these forms are defined starting around here: http://code.google.com/p/clojure/source/browse/trunk/src/jvm/clojure/lang/RT.java#171 --Chouser --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~----------~----~----~----~------~----~------~--~---