> Okay. Functions as values. Go look at the IFn interface, >> >> https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/IFn.java. >> >> >> > > Thanks for the link - this helps! When the clojure compiler generates a > class type that conforms to this interface, does it generate a .java file > which is then compiled using the java compiler? I am guessing not. I am > guessing that clojure knows how to generate a byte code version of a class > type directly. >
The Clojure compiler generates .class files and Java bytecode directly, using the ASM <http://asm.ow2.org/index.html> library. Note that Clojure code is always compiled to Java bytecode, even in the REPL; Clojure is never directly interpreted. There are some good resources on how Clojure compilation works: http://clojure.org/compilation http://www.deepbluelambda.org/programming/clojure/how-clojure-works-a-simple-namespace (namespaces also get compiled to Java classes, which is a bit less intuitive) http://stackoverflow.com/questions/3123662/compiling-clojure (if you want to play around with invoking the Clojure compiler directly) -- 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 Note that posts from new members are moderated - please be patient with your first post. 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 --- You received this message because you are subscribed to the Google Groups "Clojure" group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.