Re: How are they able to make it do this kind of thing??

2010-12-01 Thread Andy Fingerhut
Sunil, is there any particular reason why you are looking for when results of operations have identical? return true, rather than merely = return true? If it is for some reduction in allocating new memory when it is not necessary, then I can understand your motivation, although it really

documentation of clojure.set/difference

2010-12-01 Thread Sunil S Nandihalli
Hello everybody, I think the documentation of the clojure.set/difference should change to reflect the fact that only the first argument needs to be a set and the rest of the arguments can be any collection. I am reporting this from Clojure 1.2 Sunil. -- You received this message because you

Re: How are they able to make it do this kind of thing??

2010-12-01 Thread Sunil S Nandihalli
Andy, It was just for education like you said .. It was more of waw .. it is not creating another map if the value has not changed.. thing.. Sunil On Wed, Dec 1, 2010 at 1:32 PM, Andy Fingerhut andy.finger...@gmail.comwrote: Sunil, is there any particular reason why you are looking for when

Re: Ring startup processing?

2010-12-01 Thread Alex Osborne
Ken Wesson kwess...@gmail.com writes: Retries? We were discussing an atom here, not a ref. A dosync transaction may be retried. The obvious implementation for swap! would be (locking inner_value (set! inner_value.contents (apply fun inner_value.contents))) (warning: pseudocode, I assume this

Re: How are they able to make it do this kind of thing??

2010-12-01 Thread Laurent PETIT
2010/12/1 Sunil S Nandihalli sunil.nandiha...@gmail.com Andy, It was just for education like you said .. It was more of waw .. it is not creating another map if the value has not changed.. thing.. After all, it's just a special case of structural sharing ... when you share exactly the same

Re: How are they able to make it do this kind of thing??

2010-12-01 Thread Sunil S Nandihalli
yea true ... :) On Wed, Dec 1, 2010 at 3:48 PM, Laurent PETIT laurent.pe...@gmail.comwrote: 2010/12/1 Sunil S Nandihalli sunil.nandiha...@gmail.com Andy, It was just for education like you said .. It was more of waw .. it is not creating another map if the value has not changed.. thing..

Re: Ring startup processing?

2010-12-01 Thread Ken Wesson
On Wed, Dec 1, 2010 at 4:50 AM, Alex Osborne a...@meshy.org wrote: Ken Wesson kwess...@gmail.com writes: Retries? We were discussing an atom here, not a ref. A dosync transaction may be retried. The obvious implementation for swap! would be (locking inner_value (set! inner_value.contents

functional thinking

2010-12-01 Thread Michael Ossareh
Hi All, In the course of putting together my latest piece of work I decided to really embrace TDD. This is run of the mill for me in Java: - create some object that models your flow - create some object which contains your storage logic - create tests - dependency inject the correct storage

Re: Ring startup processing?

2010-12-01 Thread Alex Osborne
Ken Wesson kwess...@gmail.com writes: It looks an awful lot like swap! itself is implemented with a polling sleeplock instead of using the language's own lock. :) I suppose it's similar to a spinlock simply because it keeps retrying, like a spinlock keeps retrying to acquire. Very different

Re: Ring startup processing?

2010-12-01 Thread Ken Wesson
On Wed, Dec 1, 2010 at 8:38 AM, Alex Osborne a...@meshy.org wrote: I expect the compare it does uses .equals rather than ==? Not even that, it's a CPU instruction so it'll be identical?. The identical? predicate and the Java == operator do the same thing. Also, what's a CPU instruction?

Re: functional thinking

2010-12-01 Thread Laurent PETIT
Hi, 2010/12/1 Michael Ossareh ossa...@gmail.com Hi All, In the course of putting together my latest piece of work I decided to really embrace TDD. This is run of the mill for me in Java: - create some object that models your flow - create some object which contains your storage logic -

Re: functional thinking

2010-12-01 Thread Ken Wesson
On Wed, Dec 1, 2010 at 8:29 AM, Laurent PETIT laurent.pe...@gmail.com wrote: If so, then it may be sufficient to leverage the possibility, in your testing framework (clojure.test ? anything else ...) to redefine the functions of the backend before the tests run. I'm pretty sure there are

Re: functional thinking

2010-12-01 Thread Laurent PETIT
2010/12/1 Ken Wesson kwess...@gmail.com On Wed, Dec 1, 2010 at 8:29 AM, Laurent PETIT laurent.pe...@gmail.com wrote: If so, then it may be sufficient to leverage the possibility, in your testing framework (clojure.test ? anything else ...) to redefine the functions of the backend before

resultset-seq improvement: mapping column names

2010-12-01 Thread Ryan Twitchell
Hi all, I'm not too happy with how resultset-seq down-cases column names and turns them into keywords, as I would prefer to work with string keys in some cases. I came up with the following change to give the caller a choice to remap column keys in any way. This leaves resultset-seq's behavior

Re: Wolfram: 100 years since Principia Mathematica

2010-12-01 Thread Alec Battles
I thought his blog had some interesting points.  I enjoyed reading it.  Do I wish Mathematica was more affordable and/or open source?  Yes.  So what. That doesn't make Wolfram a lunatic or a fraud. Do you recall me saying that? -- You received this message because you are subscribed to the

Re: Wolfram: 100 years since Principia Mathematica

2010-12-01 Thread DeverLite
He may have some interesting points but... Anyone who makes grandiose claims and can't bother to give credit to the people who have helped them along the way deserves to be ignored. On Nov 27, 11:36 pm, Duane Searsmith dsearsm...@gmail.com wrote: I thought his blog had some interesting points.  

Re: documentation of clojure.set/difference

2010-12-01 Thread Stuart Halloway
The documentation is correct. It tells what the function promises to callers, not how it does it. Rely on implementation details at you peril. :-) Stu Hello everybody, I think the documentation of the clojure.set/difference should change to reflect the fact that only the first argument

Re: resultset-seq improvement: mapping column names

2010-12-01 Thread Sean Devlin
Using keywords in the resultset map is a feature. It is very common to write something like this; (map :your-column results) This takes advantage of the fact that keywords implement IFn. To the best of my knowledge SQL isn't case sensitive, downcasing the column names makes sense too, since it

Re: resultset-seq improvement: mapping column names

2010-12-01 Thread Shantanu Kumar
+1 On Dec 1, 8:01 pm, Ryan Twitchell metatheo...@gmail.com wrote: Hi all, I'm not too happy with how resultset-seq down-cases column names and turns them into keywords, as I would prefer to work with string keys in some cases.  I came up with the following change to give the caller a choice

Re: post your feedback on the conj

2010-12-01 Thread PublicFarley
Yup. Count me in as another Clojurian thirsty for videos from the conference. I'm definitely willing to fork over a couple of bucks for the pleasure as well. - Farley On Nov 30, 10:22 pm, Brent Millare brent.mill...@gmail.com wrote: +1, I surprised a video from the conference hasn't been

Re: functional thinking

2010-12-01 Thread Alyssa Kwan
Hi Mike, TDD as if you meant it - http://gojko.net/2009/02/27/thought-provoking-tdd-exercise-at-the-software-craftsmanship-conference/ What you want is mocking and stubbing (these are different things!).

Re: resultset-seq improvement: mapping column names

2010-12-01 Thread Ryan Twitchell
Sean, I entirely agree that the use of keywords as map keys is a feature of clojure (and a great one, at that), and that converting result set column names to keywords is a feature of resultset-seq. A greater feature of clojure is its extensibility. What I am after is a generalization of the

Re: functional thinking

2010-12-01 Thread Laurent PETIT
Note, though, that he did not use the words unit testing, you did :) And mocking and stubbing are techniques that can be done at different scales ... 2010/12/1 Alyssa Kwan alyssa.c.k...@gmail.com Hi Mike, TDD as if you meant it -

Re: why not change type compare functions do a compare on strings as well?

2010-12-01 Thread Daniel Werner
On 1 December 2010 02:01, Chris Riddoch riddo...@gmail.com wrote: Which reminds me, I'd really love to see a good comparison of freely available benchmarking tools for Clojure.  From past discussions on the list, I gather that benchmarking in the JVM is a rather tricky thing in general, but

Re: why not change type compare functions do a compare on strings as well?

2010-12-01 Thread Chris Riddoch
On Tue, Nov 30, 2010 at 8:09 PM, David Nolen dnolen.li...@gmail.com wrote: I've come to dislike the bandying about of premature optimization. Premature optimization is wasting time optimizing when you don't understand the problem space. That is not the case here. It's just about convenience. I

Re: functional thinking

2010-12-01 Thread Ken Wesson
On Wed, Dec 1, 2010 at 9:38 AM, Laurent PETIT laurent.pe...@gmail.com wrote: 2010/12/1 Ken Wesson kwess...@gmail.com On Wed, Dec 1, 2010 at 8:29 AM, Laurent PETIT laurent.pe...@gmail.com wrote: If so, then it may be sufficient to leverage the possibility, in your testing framework

Re: functional thinking

2010-12-01 Thread Laurent PETIT
2010/12/1 Ken Wesson kwess...@gmail.com On Wed, Dec 1, 2010 at 9:38 AM, Laurent PETIT laurent.pe...@gmail.com wrote: 2010/12/1 Ken Wesson kwess...@gmail.com On Wed, Dec 1, 2010 at 8:29 AM, Laurent PETIT laurent.pe...@gmail.com wrote: If so, then it may be sufficient to leverage the

Re: functional thinking

2010-12-01 Thread trptcolin
On Dec 1, 3:33 pm, Ken Wesson kwess...@gmail.com wrote: On Wed, Dec 1, 2010 at 9:38 AM, Laurent PETIT laurent.pe...@gmail.com wrote: 2010/12/1 Ken Wesson kwess...@gmail.com On Wed, Dec 1, 2010 at 8:29 AM, Laurent PETIT laurent.pe...@gmail.com wrote: If so, then it may be sufficient to

Re: why not change type compare functions do a compare on strings as well?

2010-12-01 Thread Ryan Sattler
I'd be highly dubious of this even if it was free, performance-wise. and are not clearly defined on strings and in general this kind of thing seems like an inroad for the kind of baffling implicit conversion-type behaviours you can see in PHP or JavaScript. Functions that do something like those

Haskell's scanl

2010-12-01 Thread Alex Baranosky
My friend's playing with Haskell, and asked me how I'd write a function to take a list and return a list of the sums like so: (f [1 2 4 8]) = [1 3 7 15] So I told him about Haskell's scanl function. Is scanl available in Haskell? These were my two versions of it and some simple benchmarks:

Re: Haskell's scanl

2010-12-01 Thread Chris Maier
That sounds like 'reductions': (reductions + [1 2 4 8]) == (1 3 7 15) Chris On Wed, Dec 1, 2010 at 10:20 PM, Alex Baranosky alexander.barano...@gmail.com wrote: My friend's playing with Haskell, and asked me how I'd write a function to take a list and return a list of the sums like so: (f [1

Re: why not change type compare functions do a compare on strings as well?

2010-12-01 Thread Tim Robinson
Actually, it was one of the features I liked about Arc, which is built on scheme. That being said Arc doesn't have as many data type's or structures, quite likely making it better suited for building generic functions, most of which can be applied across the majority of data types/structure's.

Re: Haskell's scanl

2010-12-01 Thread Ken Wesson
On Wed, Dec 1, 2010 at 10:25 PM, Chris Maier christopher.ma...@gmail.com wrote: That sounds like 'reductions': (reductions + [1 2 4 8]) == (1 3 7 15) On top of that, both the OP's algorithms are quadratic. (defn scanl2 [f seed coll] (loop [ttl seed [fst rst] coll acc []] (let [ttl (f

Re: documentation of clojure.set/difference

2010-12-01 Thread Sunil S Nandihalli
Thanks Stu .. But I think it may be reasonable to say that the rest of the arguments can be any collection and not just Set .. But I guess you have your reasons .. I will assume that every argument is just a set and not anything else. Sunil. On Wed, Dec 1, 2010 at 8:54 PM, Stuart Halloway