Re: Call for Help!: Clojure Code for JavaOne Talk

2009-05-23 Thread Chouser
On Sat, May 23, 2009 at 11:41 AM, David Nolen wrote: > > Put them in a namespace. > > (ns prime-seive) > > ... definitions ... Yes, this would probably be best. Then you can use 'defn-' instead of 'defn' for all the function definitions that you want to keep private. Another option that is usu

Re: Call for Help!: Clojure Code for JavaOne Talk

2009-05-23 Thread David Nolen
Put them in a namespace. (ns prime-seive) ... definitions ... On Saturday, May 23, 2009, michaelg wrote: > > Thanks Chouser, very nice! I am quite aware of the performance boost > of using ints instead of strings -- this was an intentional choice on > my part. When I first solved the problem,

Re: Call for Help!: Clojure Code for JavaOne Talk

2009-05-23 Thread michaelg
Thanks Chouser, very nice! I am quite aware of the performance boost of using ints instead of strings -- this was an intentional choice on my part. When I first solved the problem, I wrote it in Scala and used ints. I have one question for you, and this will show my OOP roots :-) How would you en

Re: Call for Help!: Clojure Code for JavaOne Talk

2009-05-21 Thread Timothy Pratley
Here is a more direct translation with type hints: (with-open [r (new java.io.BufferedReader (new java.io.FileReader "words.txt"))] (sort-by #(.toLowerCase #^String %) (mapcat #(.split #^String % " ") (line-seq r With the obvious advantage of not reading the file as a string. R

Re: Call for Help!: Clojure Code for JavaOne Talk

2009-05-21 Thread Timothy Pratley
> http://fupeg.blogspot.com/2009/05/javaone-talk-word-sort.htmlhttp://fupeg.blogspot.com/2009/05/javaone-talk-ruby-word-sort.html (sort-by #(.toLowerCase %) (.split (slurp "words.txt") " ") > implementations:http://fupeg.blogspot.com/2009/05/javaone-talk-prime-sieve.html CG had a very nice sol

Re: Call for Help!: Clojure Code for JavaOne Talk

2009-05-21 Thread Chouser
On Thu, May 21, 2009 at 4:59 AM, michaelg wrote: > > So if anyone would like to help, I would be very appreciative. All I > can offer is recognition in my JavaOne talk. All I ask from the > implementations is that they try to stay true to how the Java version > worked, while also trying to be fai

Call for Help!: Clojure Code for JavaOne Talk

2009-05-21 Thread michaelg
As they say on sports radio, long time listener, first time caller... I am giving a talk at JavaOne on alternative language performance on the JVM. I have written a couple of algorithms in Java, and then mostly equivalent ones in Groovy, Ruby, Python, Scala, and Fan. I would like to include Clojur