Re: Are you supposed to turn ClojureCLR into DLLs?
Yes, you can compile the code to a DLL using th compile function, similarly to how it's done on the JVM. You have to set two env. variables, though (just like one has to set the classpath for the JVM): clojure.compile.path and clojure.load.path -Roland On Jun 3, 8:49 am, Peter Hultgren peter.micros...@gmail.com wrote: Hi, I'm new to ClojureCLR and the DLR, so I'm trying to grasp the basic concepts of it. If I want to call Clojure code from C#, is it possible to compile the Clojure code to a DLL and then reference it from my C# project, or am I always supposed to load the script using methods? // Peter Hultgren -- 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
Re: update-in oddness
On Jun 4, 7:37 am, Heinz N. Gies he...@licenser.net wrote: Update-in behaves oddly when getting an empty path. (update-in [] {1 2} (constantly {2 3})) returns {nil {2 3} 1 2} not {2 3} as I'd expect. get-in works well with empty pathes so I think this isn't a good behavior. I don't know why you expect that to do anything - first of all, the second argument to update-in should be a seq of keys. In any case, it throws nth not supported on this type: PersistentArrayMap [Thrown class java.lang.UnsupportedOperationException] -- 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
Re: Question on destructure source
Very clear, much appreciate! On Jun 4, 2:55 am, Chouser chou...@gmail.com wrote: On Thu, Jun 3, 2010 at 9:38 AM, YD ydong.pub...@gmail.com wrote: Hi, When 'destructure' is doing a map destructuring, 'pmap' is the function to use. 'pmap' will do some kind of process to the given bindings using these lines of code: bes (reduce (fn [bes entry] (reduce #(assoc %1 %2 ((val entry) %2)) (dissoc bes (key entry)) ((key entry) bes))) (dissoc b :as :or) {:keys #(keyword (str %)), :strs str, :syms #(list `quote %)}) I'm confused. Since every time ((key entry) bes) evaluates to nil, the inner reduce will never really do some useful thing. What's the purpose of this piece of code? Yes, if ((key entry) bes) is nil then the inner reduce simply returns the binding map as it stands. The purpose of this code is to support the :keys, :strs, and :syms keys in map destructuring: (let [{:keys [a b]} {:a 1 :b 2}] [a b]) ;= [1 2] In this example, (key entry) will be :keys for one of the iterations of the inner reduce. When (key entry) is :keys, ((key entry) bes) will be [a b], and the inner reduce will process each item of that vector, finally returning {a :a b :b} as the whole binding map. Which means the above example does exactly the same things as: (let [{a :a b :b} {:a 1 :b 2}] [a b]) ;= [1 2] ...which is what you'd do if there was no support for :keys --Chouserhttp://joyofclojure.com/ -- 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
Re: : Google Chrome extension for TryClojure (try-clojure.org)
Feka, please try a 0.2.1 version (https://chrome.google.com/extensions/ detail/lhmgejcdhmollecbianopflcfdaennle) On Jun 1, 8:49 pm, feka tfek...@gmail.com wrote: Good idea! Thanks. (And try-clojure is good idea, too. So they also merit the thanks.) I can't make it grab the selection and evaluate it though. Am I missing something? Mac OS X 10.6.3, Chromium (Revision 48615) Feka On May 31, 12:04 pm, sergey-miryanov sergey.mirya...@gmail.com wrote: Hi all, I made a little extension for google chrome. It allows to start try- clojure REPL via clicking on toolbar button. Also it grabs selected text and evaluates it in REPL. Feel free to comment, report bugs and suggestions. /Sergey -- 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
Re: Android 'dex' stage takes a very long time with Clojure
I've pushed my changes to clojure-master to github (master from today): git://github.com/MHOOO/clojure.git This should work so far. As for a hello-clojure-android application: I'll try to get my example up and running on the weekend - possibly together with a leiningen plug-in which automates the install process (as there are some preconditions to be met before clojure can run). On Jun 2, 3:01 pm, MHOOO thomas.karol...@googlemail.com wrote: No, I have yet to set up a public repo. I'll see to it that I at least set one up for the modified clojure-master project sometime today or tomorrow. As for a hello-world project, I'm currently running into some issues with android's call stack limit: (use 'swank.swank) kinda uses too much of that. I've possibly solved the problem by running clojure entirely in its own thread, however for some reason I get exceptions about *compile-path* not being set upon initialization, so I've tried to fix the problem by manually specifying it - but that results in strange errors which I have yet to resolve. On Jun 2, 1:30 am, Matt Clark matt.clar...@gmail.com wrote: Do you have a public repository of the work you've done so far? I'm very interested to learn more about this. On May 29, 7:31 pm, MHOOO thomas.karol...@googlemail.com wrote: Well, that was easy enough. I modified the load function inside RT.java to load classes/namespaces out of .dex files. (use 'my.compiled.namespace) will now look for either the compiled .class (and load it), or it will look for a .clj (and compile load it - thanks to George Jahad's work), or it will look for a .dex file (my.compiled.namespace.dex) inside the .apk and try to load the class from there. Charming! I've already split clojure-master into several parts (.dex files for core,main,zip,set,walk,xml,java,inspector,pprint,repl), so now the next step would be to figure out how to get it all together and integrate it with leiningen: Build clojure-master .dex files (- done) with a custom main (- todo) which calls the users main android activity (- todo), package everything into an apk (- done) and install it on the emulator (- done). On May 29, 4:07 pm, MHOOO thomas.karol...@googlemail.com wrote: I'd like to try to compile the clojure code (i.e. its different parts like .core, .main, .set, etc) into different .dex files so as to speed up both compilation (since you'll only have to recompile those .dex files which have changed) and start-up (since only those .dex files are loaded which are needed during program runtime). However I'm not quite sure where to hook into as I have only little understanding of how clojure loads files. Is there a function somewhere in the java/ clojure side of the code which is responsible for finding a namespace (possibly compiling it first) and loading it? -- 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
Re: update-in oddness
On Jun 4, 2010, at 11:15 , Joost wrote: On Jun 4, 7:37 am, Heinz N. Gies he...@licenser.net wrote: Update-in behaves oddly when getting an empty path. (update-in [] {1 2} (constantly {2 3})) returns {nil {2 3} 1 2} not {2 3} as I'd expect. get-in works well with empty pathes so I think this isn't a good behavior. I don't know why you expect that to do anything - first of all, the second argument to update-in should be a seq of keys. In any case, it throws nth not supported on this type: PersistentArrayMap [Thrown class java.lang.UnsupportedOperationException] Sorry I mixed arguments, it should be (update-in {1 2} [] (constantly {2 3})) -- 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
Re: update-in oddness
On Jun 4, 1:42 pm, Heinz N. Gies he...@licenser.net wrote: Sorry I mixed arguments, it should be (update-in {1 2} [] (constantly {2 3})) Yes, that gives {nil {2 3}, 1 2} You're not giving any key in the key list, so that is the reason there's a nil key now, and {2 3} is just the value that you give it, since that's what ((constantly {2 3}) nil) returns. Seems correct as far as the documentation of update-in is concerned. Joost. -- 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
Re: update-in oddness
On Jun 4, 2:03 pm, Joost jo...@zeekat.nl wrote: Seems correct as far as the documentation of update-in is concerned. Addendum: though I think you've got a point in that inserting a nil key is unexpected. Personally, I don't really know what to expect from that expression. Joost. -- 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
Re: update-in oddness
On Jun 4, 2010, at 14:03 , Joost wrote: On Jun 4, 1:42 pm, Heinz N. Gies he...@licenser.net wrote: Sorry I mixed arguments, it should be (update-in {1 2} [] (constantly {2 3})) Yes, that gives {nil {2 3}, 1 2} You're not giving any key in the key list, so that is the reason there's a nil key now, and {2 3} is just the value that you give it, since that's what ((constantly {2 3}) nil) returns. Seems correct as far as the documentation of update-in is concerned. I'd expect that a empty key works on the entire map, just as get-in with en empty key returns the entire map, this is kind of very important if you work with automatically with keys since otherwise you always have to handle the special case []. This is very annoying :( here an example: (if-let [r (butlast @path)] (do (alter m update-in r dissoc (last @path)) (alter m update-in r assoc {:name @sr} c)) (do (alter m dissoc (last @path)) (alter m assoc {:name @sr} c))) -- 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
Re: update-in oddness
On Jun 4, 2010, at 14:11 , Heinz N. Gies wrote: On Jun 4, 2010, at 14:03 , Joost wrote: On Jun 4, 1:42 pm, Heinz N. Gies he...@licenser.net wrote: Sorry I mixed arguments, it should be (update-in {1 2} [] (constantly {2 3})) Yes, that gives {nil {2 3}, 1 2} You're not giving any key in the key list, so that is the reason there's a nil key now, and {2 3} is just the value that you give it, since that's what ((constantly {2 3}) nil) returns. Seems correct as far as the documentation of update-in is concerned. So for how I'd expect it to work: (defn update-in* ([m [k ks] f args] (if ks (assoc m k (apply update-in* (get m k) ks f args)) (if k (assoc m k (apply f (get m k) args)) (apply f m args) user (get-in {1 2} []) {1 2} user (update-in* {1 2} [] assoc 1 3) {1 3} In opposite of how it works: user (update-in {1 2} [] assoc 1 3) {nil {1 3}, 1 2} -- 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
Re: update-in oddness
On Fri, Jun 4, 2010 at 10:04 AM, Heinz N. Gies he...@licenser.net wrote: On Jun 4, 2010, at 14:11 , Heinz N. Gies wrote: On Jun 4, 2010, at 14:03 , Joost wrote: On Jun 4, 1:42 pm, Heinz N. Gies he...@licenser.net wrote: Sorry I mixed arguments, it should be (update-in {1 2} [] (constantly {2 3})) Yes, that gives {nil {2 3}, 1 2} You're not giving any key in the key list, so that is the reason there's a nil key now, and {2 3} is just the value that you give it, since that's what ((constantly {2 3}) nil) returns. Seems correct as far as the documentation of update-in is concerned. So for how I'd expect it to work: (defn update-in* ([m [k ks] f args] (if ks (assoc m k (apply update-in* (get m k) ks f args)) (if k (assoc m k (apply f (get m k) args)) (apply f m args) user (get-in {1 2} []) {1 2} user (update-in* {1 2} [] assoc 1 3) {1 3} I agree with the spirit of your argument, but not your implementation: (update-in* {nil 2} [nil] (constantly 3)) ;= 3 Perhaps: (defn update-in* [m ks f args] (if-let [[k mk] ks] (if mk (assoc m k (apply update-in* (get m k) mk f args)) (assoc m k (apply f (get m k) args))) (apply f m args))) (update-in* {nil 2} [nil] (constantly 3)) ;= {nil 3} --Chouser http://joyofclojure.com/ -- 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
Re: Clojure on the tiobe index
Tiobes rankings always seems a little dubious to me. Delphi more popular than Javascript? Really? Google Go more popular than Lisp/Scheme/Clojure? Ranking those three together is an atrocity, by the way. Just because they all have paren's doesn't make them the same. Anyway, I'm sure Tiobe measures something. But I'm not sure it's anything useful. On Jun 4, 10:11 am, BerlinBrown berlin.br...@gmail.com wrote: Nice. http://www.tiobe.com/index.php/content/paperinfo/tpci/index.html It is number 16. ...combined with Lisp and Scheme. -- 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
Re: update-in oddness
On Jun 4, 2010, at 16:23 , Chouser wrote: I agree with the spirit of your argument, but not your implementation: (update-in* {nil 2} [nil] (constantly 3)) ;= 3 As so often Chouser, you are of cause totally right :). I just realized the flaw when I was about to open a ticket but you were faster ;) well this are good news so since I don't have a CA signed yet (actually I do just not send it :P) so one could use your code as a fix. Regards, Heinz -- 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
Re: Clojure on the tiobe index
I read the explanation on how they compute their charts. I do not see why a Cobol or Fortran programmer would query the Web for references on a regular basis. What can be the significance of computing references on the Web about older languages that do not evolve too much but that have a large application base ? There's still a few hundred millions of Cobol lines out there in all these bank processing centers and surely they are maintained somehow by human brains. Seeing Cobol at the 24th rank does not make sense to me. The popularity they say they measure here must be taken in the same way as gossip tabloids... ephemeral and by no way reflecting real life :))) It's not because the sales of cokes, chips and alike are blooming that it makes them the best choice health wise. Beurk... Luc P. Luke VanderHart luke.vanderh...@gmail.com wrote .. Tiobes rankings always seems a little dubious to me. Delphi more popular than Javascript? Really? Google Go more popular than Lisp/Scheme/Clojure? Ranking those three together is an atrocity, by the way. Just because they all have paren's doesn't make them the same. Anyway, I'm sure Tiobe measures something. But I'm not sure it's anything useful. On Jun 4, 10:11 am, BerlinBrown berlin.br...@gmail.com wrote: Nice. http://www.tiobe.com/index.php/content/paperinfo/tpci/index.html It is number 16. ...combined with Lisp and Scheme. -- 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
Re: Clojure on the tiobe index
I don't think tiobe is all accurate index of anything. But when you look at the actual rankings, they seem to line up, especially for the mainstream languages. I could see where Delphi ranks high on the list. Go is a little odd. But I was glad to see Clojure get a little recognition. And I am still one of those guys that still considers Clojure as a JVM language. On Jun 4, 1:51 pm, lprefonta...@softaddicts.ca wrote: I read the explanation on how they compute their charts. I do not see why a Cobol or Fortran programmer would query the Web for references on a regular basis. What can be the significance of computing references on the Web about older languages that do not evolve too much but that have a large application base ? There's still a few hundred millions of Cobol lines out there in all these bank processing centers and surely they are maintained somehow by human brains. Seeing Cobol at the 24th rank does not make sense to me. The popularity they say they measure here must be taken in the same way as gossip tabloids... ephemeral and by no way reflecting real life :))) It's not because the sales of cokes, chips and alike are blooming that it makes them the best choice health wise. Beurk... Luc P. Luke VanderHart luke.vanderh...@gmail.com wrote .. Tiobes rankings always seems a little dubious to me. Delphi more popular than Javascript? Really? Google Go more popular than Lisp/Scheme/Clojure? Ranking those three together is an atrocity, by the way. Just because they all have paren's doesn't make them the same. Anyway, I'm sure Tiobe measures something. But I'm not sure it's anything useful. On Jun 4, 10:11 am, BerlinBrown berlin.br...@gmail.com wrote: Nice. http://www.tiobe.com/index.php/content/paperinfo/tpci/index.html It is number 16. ...combined with Lisp and Scheme. -- 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
Embedded Clojure
I am working on a simple DSL and wanted to some form of embedded Clojure to where I can invoke Clojure scripts and have those scripts not effect the bootloader/my main application code. It seems there are two approaches that sound doable. (A) - With the dynamically loaded clojure scripts, the DSL code, I could load these in its own specific clojure namespace and then clean- up the namespace once it is done. This is discussed in this thread: http://groups.google.com/group/clojure/browse_thread/thread/d98cedb860f16a34/21704fda80aaf067?q=embedded+clojure#21704fda80aaf067 Here is my question, how would I delete the namespace. I may use Java code to run the embedded DSL clojure scripts. (B) - Run new instances of clojure in a completely separate classloader. Option B is OK except writing custom classloaders and dynamically load the clojure jar instance may be too much work for what I am trying to do. What do you think about option A or B, do you have any code that does this? -- 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
Re: The State of Clojure, Summer 2010
Responses to the survey have started to trickle off (after a very healthy raft of feedback, BTW). Given that, I've decided to shut the survey off at the end of today, probably around midnight EDT. You have until then to toss in your 2¢, and be included in the survey results (which I'll be posting publicly early next week in a separate post): http://bit.ly/dCmlZL Of course, if you know of someone who's using Clojure, but who might not have participated in the survey (not everyone is as tuned into twitter and the mailing list here as others, of course), do feel free to pass along the link above, etc. Have a good weekend, - Chas On Jun 2, 2010, at 1:48 PM, Chas Emerick wrote: I have now been using Clojure as my primary programming language for almost exactly two years. Clojure 1.2 is nearing release. The Clojure community is larger than it ever has been, and shows no sign of slackening its growth. It seems like now would be a good time to take stock of where the community is, how people came to use Clojure, and how it's being used in the world. To do that, I put together a quick, 9-question survey through Google Spreadsheets, embedded below. Hopefully enough responses will come through that we'll be able to get a good picture of the current state of affairs, and maybe a little insight into where Clojure can and should make headway in the future. The survey is available here: http://muckandbrass.com/web/x/AQBf Of course, after people have had enough time to participate, all of the data will be opened up for everyone to see. Cheers, - Chas -- 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
Re: Clojure on the tiobe index
On Fri, 4 Jun 2010 11:59:46 -0700 (PDT) BerlinBrown berlin.br...@gmail.com wrote: I don't think tiobe is all accurate index of anything. But when you look at the actual rankings, they seem to line up, especially for the mainstream languages. I could see where Delphi ranks high on the list. Go is a little odd. I suspect Go is getting interest because of Google's success. Compare it to D or similar. If Google were pushing it as the tool for Android, I'd expect it to be just a bit behind Objective-C. I'm not sure what you mean about Delphi. But the definition says this includes a slew of Pascal variants that picked up Delphi features as well as some other Delphi tools. The grouping seems odd, but if you think of it as all OO Pascal variants, the rank makes a bit more sense. mike -- Mike Meyer m...@mired.org http://www.mired.org/consulting.html Independent Network/Unix/Perforce consultant, email for more information. O ascii ribbon campaign - stop html mail - www.asciiribbon.org -- 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
runtime inspection: how to get a list of all defined keywords?
I asked this on the swank-clojure list too*, but no responses so far. I want swank-clojure to complete on keywords as well as vars, but the only place I can find that has that information is clojure.lang.Keyword.table, which is private (probably for good reasons). Is there any way to get a seq of the defined keywords at run time? I imagine that would be interesting for other development/debugging systems beside SLIME too. Thanks, Joost. * http://groups.google.com/group/swank-clojure/browse_thread/thread/5c938a3ce3a5d42b -- 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
Re: Having trouble getting full performance from a quad-core with trivial code
I have some new data that suggests there are issues inherent to pmap and possibly other parallelism with Clojure on older Intel quad+ core machines. I added a noop loop to the benchmark. It looks like this: (defn noops [n] (when ( n 0) (recur (- n 1 Running those in parallel is also no faster on the Xeon 5150 box with four cores than it is with two. It has been suggested that memory contention is the problem with this machine. I suspect Clojure's overhead relative to Java is the reason that parallel Java benchmarks get more out of the four cores on this machine, but don't quote me on that. I had someone run the benchmarks on an 8-core Nehalem Mac Pro. Those results are quite a bit different from mine. On the true factorial benchmark, four threads are twice as fast as two. Eight threads are 50% faster than four, but 16 threads are about twice as fast as four. Intermediate numbers are a bit variable, but it seems like hyperthreading actually speeds things up quite a bit on this benchmark. ka's version of fac, which I've renamed spin-mult scales linearly with the number of physical cores, but slows down with between 9 and 15 threads. 16 threads is about equal to 8. I've put the benchmarks up on github: http://github.com/zakwilson/npmap I'm going to try changing spin-mult to use dotimes and see how that runs on several machines. Initial results on the Xeon 5150 box suggest that using dotimes instead of recur solves the problem, and I'll probably be changing the benchmarks to further explore the issue. -- 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
Re: bit-and reflection warning
On Jun 3, 2010, at 24:02 , rzeze...@gmail.com wrote: I was able to make this go away by adding a method to Numbers.java. I have a use case where I'm calling bit-and with two longs tens of millions of times. Is there another way I could avoid this reflection without this change to the Java source? The only way to avoid it without changing the java code is to box it (bit-and (Long/valueOf (long 0x1)) (Long/valueOf (long 0x1))) or (bit-and (num (long 0x1)) (num (long 0x1))) I had a similar patch, because I did not wanted to box. I've also noticed that short and byte are totally missing from the Numbers.java. I can put together a patch for short, byte and missing long cases. Would it be something useful? _ __ | \o/__ |_/|\_| -- 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