Re: Risks of (over-)using destructuring?

2009-07-25 Thread Laurent PETIT
Hi, 2009/7/25 jan jan.mare...@gmail.com Laurent PETIT laurent.pe...@gmail.com writes: 2009/7/24 pcda...@gmail.com pcda...@gmail.com On Jul 23, 10:15 pm, Richard Newman holyg...@gmail.com wrote: Coming from an OO background which puts a strong focus on data

Re: Tests in Clojure source

2009-07-25 Thread ajlopez
Hi people! Thanks for the answers, Wilson, Richard. Yesterday, I could clone the CLR branch from github (github hates my IE7 browser, I switched to FireFox): http://github.com/richhickey/clojure-clr/tree/master I found in the code the kind of test I was looking for. Just curious: any attempt

Re: Simple questions from a newbie

2009-07-25 Thread Meikel Brandmeyer
Hi, Am 25.07.2009 um 15:08 schrieb ajlopez: 1) Why the fn special form receives an array as list of parameters? That is, why Clojure is using: (fn [x y] instead of (fn (x y) ... or both Any rationale behing this decision? In Clojure vectors are used everywhere, where the grouping

Re: Very minor problem in the REPL

2009-07-25 Thread Stuart Sierra
That's a general problem with multiple threads printing to the same stream, and not something that can be easily avoided. -Stuart On Jul 25, 12:48 pm, ronen nark...@gmail.com wrote: Iv stumbled this also when using Threads, (http://

validate inconsistency

2009-07-25 Thread Mark Volkmann
Looking at the source ARef.java, I see that the validate method will throw an IllegalStateException if the validator function either returns false or throws a non-RuntimeException. The setValidator method immediately validates the Ref using the new validator function. It always throws a

where to suggestion changes

2009-07-25 Thread Mark Volkmann
Should I use this mailing list to suggest changes to the Clojure implementation or some other avenue? Some suggestions I may have are pretty simple. For example, in LockingTransaction.java I see: ref.validate(ref.getValidator(), e.getValue()); That could be replaced by:

Re: where to suggestion changes

2009-07-25 Thread Rich Hickey
On Jul 25, 3:20 pm, Mark Volkmann r.mark.volkm...@gmail.com wrote: Should I use this mailing list to suggest changes to the Clojure implementation or some other avenue? Some suggestions I may have are pretty simple. For example, in LockingTransaction.java I see:

Re: where to suggestion changes

2009-07-25 Thread Mark Volkmann
On Sat, Jul 25, 2009 at 2:53 PM, Rich Hickeyrichhic...@gmail.com wrote: On Jul 25, 3:20 pm, Mark Volkmann r.mark.volkm...@gmail.com wrote: Should I use this mailing list to suggest changes to the Clojure implementation or some other avenue? Some suggestions I may have are pretty simple.

Re: How to write performant functions in clojure (and other functional languages)

2009-07-25 Thread atucker
I wonder if any of the Clojurians on here might like to describe how one might write the factorial function as a parallel one? Taking advantage of the associativity of multiplication, along the lines of 16! = (((1*2)*(3*4)) * ((5*6)*(7*8))) * (((9*10)*(11*12)) * ((13*14)* (15*16))) On Jul 24,

Re: Simple questions from a newbie

2009-07-25 Thread Michael Wood
Hi 2009/7/25 ajlopez ajlopez2...@gmail.com: [...] from loop* to loop, let* to let, fn* to fn... Are all *-ended names special forms? [...] No, you can name your own functions/macros something* if you want to. The * at the end normally just means that this function/macro is similar to the one

Re: How to write performant functions in clojure (and other functional languages)

2009-07-25 Thread Timothy Pratley
The parallel library wraps the ForkJoin library scheduled for inclusion in JDK 7: http://gee.cs.oswego.edu/dl/concurrency-interest/index.html You'll need jsr166y.jar in your classpath in order to use this library. (use '(clojure.parallel)) (clojure.parallel/preduce * (range 2 16)) On Jul 26,