Oh, one other thing, although it might actually be slower than 1.3's primitive goodness:
If you want to keep the unchecked operations, and make them on 32-bit ints, I've been using macros like this so that the same file can compile with both 1.2 and 1.3: (defmacro my-unchecked-inc-int [& args] (if (and (== (*clojure-version* :major) 1) (== (*clojure-version* :minor) 2)) `(unchecked-inc ~@args) `(unchecked-inc-int ~@args))) Then replace 'unchecked-inc' throughout the rest of the code with my-unchecked-inc-int. The reason why I don't know whether that is necessarily the best thing to do for 1.3 is that the default primitive integer type for passing between functions is long, not int. Andy On Mar 13, 2011, at 10:36 AM, Nick Zbinden wrote: > Hallo all, > > I have been looking at the binary-trees in the language shotout. > http://shootout.alioth.debian.org/u64q/program.php?test=binarytrees&lang=clojure&id=5 > > I want to make it work with the primitiv support in clojure 1.3 but I > cant get it to work. Maybe its my misunderstanding in the new primitiv > support. > > Here is my code: > https://github.com/nickik/IDPA-Programmiersprachen-Benchmarken/blob/master/clojure/src/clojure/binarytrees_me.clj > (I removed some stuff like unchecked operations for now I can add that > stuff again later. Its easier to understand that way) > > this is basiclly the original: > https://github.com/nickik/IDPA-Programmiersprachen-Benchmarken/blob/master/clojure/src/clojure/binarytrees.clj > > I always get the error: > error: java.lang.IllegalArgumentException: Unable to resolve > classname: clojure.core$long@1539d49, compiling:(/home/nick/alltech/ > Allgemein_Programming/IDPA-Programmiersprachen-Benchmarken/clojure/src/ > clojure/binarytrees_me.clj:32) > > Do I maybe need to use thes operations like +'? > > Any other performance improving tipps would be nice too. > > > -- > 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 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