Re: Multiple indexing for vectors/maps

2008-10-19 Thread Meikel Brandmeyer
Hello, Am 19.10.2008 um 00:12 schrieb kwatford: I don't think adding this should conflict with any existing code, though I did notice that get currently accepts and apparently ignores one extra parameter. No. It does not ignore the extra parameter! This is a default value, which is returned

CTPOP emulation in JVM

2008-10-19 Thread Krukow
I was reading though Phil Bagwells paper Ideal Hash Trees, when I encountered this paragraph: Note that the performance of the algorithm is seriously impacted by the poor execution speed of the CTPOP emulation in Java, a problem the Java designers may wish to address. I am assuming he means

Fibonacci function performance compare between clojure and scala

2008-10-19 Thread [EMAIL PROTECTED]
Clojure's (defn fib [n] (if (or (zero? n) (= n 1)) 1 (+ (fib (dec n) ) (fib (- n 2) (time (fib 36)) Elapsed Time: 10475.325226 msecs 24157817 Scala's def fib(n:Int):Int=if (n==0||n==1)1 else fib(n-1)+fib(n-2) def time(cal: =Int)={ val

Re: Fibonacci function performance compare between clojure and scala

2008-10-19 Thread Parth Malwankar
On Oct 19, 7:49 pm, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Clojure's (defn fib [n] (if (or (zero? n) (= n 1)) 1 (+ (fib (dec n) ) (fib (- n 2) (time (fib 36)) Elapsed Time: 10475.325226 msecs 24157817 Scala's def fib(n:Int):Int=if (n==0||n==1)1 else

Re: Fibonacci function performance compare between clojure and scala

2008-10-19 Thread [EMAIL PROTECTED]
Scala is sure to use java primitive int type underline, i.e value type and boxed to java Integer when necessarily But why not Clojure auto make this ? gerry On Oct 19, 11:31 pm, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Here is coersion version for Clojure (defn fib [n]   (let [n  

Re: Fibonacci function performance compare between clojure and scala

2008-10-19 Thread Lauri Oherd
There is also a faster way to calculate fibonacci numbers in Clojure (code taken from from http://en.wikibooks.org/wiki/Clojure_Programming#Lazy_Fibonacci): (defn fib-seq [] ((fn rfib [a b] (lazy-cons a (rfib b (+ a b 0 1)) user= (time (take 38 (fib-seq))) Elapsed time:

Submitting patches

2008-10-19 Thread Matt Revelle
Rich, I submitted a patch that adds support for exposing protected fields inherited indirectly through the super class in gen-class. No problem if it's unwanted, but would be good to know either way. Suppose the original message should've had patch in the subject line; it's exposing ancestral

Re: Fibonacci function performance compare between clojure and scala

2008-10-19 Thread [EMAIL PROTECTED]
This lazy cached calculate is wonderful ,but i think the benefit from it mostly due to cache . On Oct 19, 11:56 pm, Lauri Oherd [EMAIL PROTECTED] wrote: There is also a faster way to calculate fibonacci numbers in Clojure (code taken from

Re: offtopic - where are you come from? (poll)

2008-10-19 Thread J . Pablo Fernández
I think it might be more important where people are, where they live, than where they come from. I live in Zürich, Switzerland. On Oct 17, 11:27 am, Rastislav Kassak [EMAIL PROTECTED] wrote: Hello Clojurians, I think after 1st year of Clojure life it's good to check how far has Clojure

Re: Fibonacci function performance compare between clojure and scala

2008-10-19 Thread Meikel Brandmeyer
Hello, Am 19.10.2008 um 17:56 schrieb Lauri Oherd: There is also a faster way to calculate fibonacci numbers in Clojure (code taken from from http://en.wikibooks.org/wiki/Clojure_Programming#Lazy_Fibonacci): (defn fib-seq [] ((fn rfib [a b] (lazy-cons a (rfib b (+ a b 0 1))

Testing Clojure (was Re: Bug? Strange set equality (r1075))

2008-10-19 Thread Stephen C. Gilardi
On Oct 19, 2008, at 5:11 PM, J. McConnell wrote: I've been thinking the same thing for awhile now and I'd love to help contribute to an effort like this. Thanks for getting the idea out there. You're welcome. It seems like clojure.contrib could be a more convenient place to keep this than

Swank-clojure: slime-eval-print-last-expression failing.

2008-10-19 Thread Luke Hope
Hello, I am a common lisp programmer and I use Slime extensively. I am looking into using Clojure for an upcoming project (I have experience with ABCL, but it is too slow) and I have clojure and swank-clojure installed. Unfortunately slime-eval-print-last-expression (C-j in *slime-scratch*) is

Re: Testing Clojure (was Re: Bug? Strange set equality (r1075))

2008-10-19 Thread Paul Barry
I like this idea and I would be willing to contribute. On Oct 19, 6:43 pm, Stephen C. Gilardi [EMAIL PROTECTED] wrote: On Oct 19, 2008, at 5:11 PM, J. McConnell wrote: I've been thinking the same thing for awhile now and I'd love to help contribute to an effort like this. Thanks for

Re: Testing Clojure (was Re: Bug? Strange set equality (r1075))

2008-10-19 Thread Michael Beauregard
Ditto. I've been thinking about this for a few weeks and would be happy to help out where I can. On Sun, Oct 19, 2008 at 6:22 PM, Paul Barry [EMAIL PROTECTED] wrote: I like this idea and I would be willing to contribute. On Oct 19, 6:43 pm, Stephen C. Gilardi [EMAIL PROTECTED] wrote: On Oct

Re: Newbie question on the use of functional hash maps

2008-10-19 Thread wwmorgan
If you're interested only in counting the number of unique words, then you don't even need a map. You can get by with a set, like this: (defn unique-words-in-file [file] (count (set (split-on-whitespace (slurp file) slurp reads file into a String object in memory. The hypothetical

Re: offtopic - where are you come from? (poll)

2008-10-19 Thread [EMAIL PROTECTED]
Austin, Texas, USA. On Oct 17, 9:18 am, Eric Rochester [EMAIL PROTECTED] wrote: Atlanta, Georgia, US On Fri, Oct 17, 2008 at 5:27 AM, Rastislav Kassak [EMAIL PROTECTED]wrote: Hello Clojurians, I think after 1st year of Clojure life it's good to check how far has Clojure spread all

Re: Clojure + Terracotta

2008-10-19 Thread Alex Miller
Rich, I'm the tech lead for the transparency team at Terracotta and this is not exactly correct. For example, while you can read clustered state outside of a clustered lock, it's possible for the tc memory manager to clear that state at any time, allowing you to see a null instead of the real

Re: Beginners (and idiomatic Clojure)

2008-10-19 Thread Krukow
On Oct 20, 12:30 am, Paul Barry [EMAIL PROTECTED] wrote: Krukow, I agree, it would help to have a resource for learning Clojure.  For now, my best advice is to pick a real project to start working and then specific questions in the IRC room, #clojure on irc.freenode.net. Within a few