2014-06-22 9:12 GMT+02:00 Reid McKenzie <rmckenzi...@gmail.com>: > > since there's no other way that we can take a > function "as a value" prior to JVM 1.8 which has bytecode lambdas and > which the reference Clojure implementation doesn't leverage yet if ever. >
Java 8 gained no such feature. Lambda expressions are syntax sugar for almost the thing, clojure's fn does: Instantiating an anonymous inner class for an interface with a single arity. The only concept that jvm has of a first class function, are the interfaces in java.util.function, as of Java 8 Sorry for the nitpick! Concerning more extensive compiler optimizations: The simplistic approach of the compiler has the benefit of generating pretty predictable byte code, which is good for a lot of cases, as long as the JIT can optimize it and as long as you don't need fast startup. The JIT can do pretty amazing stuff like inlining heap allocations onto the stack, if they don't escape. So in theory that could eliminate lazy-seqs, partial functions and other wrappers. I'd also like to see more extensive optimization by the clojure compiler, but I wouldn't pass the burden of implementing them onto anyone, before clojure.tools.{analyzer,emitter} are used as the canonical compiler. cheers -- 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.