Re: binding and bundles of variables

2009-08-08 Thread John Harrop
On Sat, Aug 8, 2009 at 9:52 AM, Rich Hickey wrote: > > On Sat, Aug 8, 2009 at 5:53 AM, Meikel Brandmeyer wrote: > > Hi, > > > > Am 08.08.2009 um 02:52 schrieb samppi: > > > >> Great, thanks. Is clojure.lang.Var/pushThreadBindings a public, > >> supported part of the API? Can I use it without fear

Re: Clojure performance tests and clojure a little slower than Java

2009-08-08 Thread John Harrop
On Sat, Aug 8, 2009 at 5:23 AM, Mark Engelberg wrote: > > On Fri, Aug 7, 2009 at 5:14 PM, John Harrop wrote: > > (if (and (not (= 0 i)) (< (+ zr2 zi2 limit-square))) > > I believe that (zero? i) is faster than (= 0 i). On primitive ints? Have you tested it? --~--~-~--~~-

Re: Question about pmap

2009-08-08 Thread Chad Harrington
Andy, I just thought I'd mention that for 80 cents you can rent an hour on an 8-core EC2 machine with 7GB of RAM. We use EC2 a lot for such things at work. It may be an easy way for you to accomplish your goals. http://aws.amazon.com/ec2/instance-types/ Chad Harrington chad.harring...@gmail.com

Re: Current API doc (for HEAD)

2009-08-08 Thread Tom Faulhaber
On Aug 7, 1:43 am, Daniel wrote: > IIRC you can use plain HTML on the github pages. They are only > processed by Jekyll, if you have the YAML front-matter in the file > (http://wiki.github.com/mojombo/jekyll/usagesee index.html section). Yup, I'm skipping the Jekyll and doing vanilla HTML + CSS

Re: enhancement request: a simple way to read a file

2009-08-08 Thread Daniel Lyons
On Aug 8, 2009, at 3:37 AM, Albert Cardona wrote: > I am amused that the two answers I got (yours and Vagif's) tried to > teach me about contrib duck-streams, a lib which I know and use. > > To restate my point: file I/O is incomplete in clojure core, lacking > the > consistency of other core

Re: Current API doc (for HEAD)

2009-08-08 Thread Tom Faulhaber
> Great! - I need to think about this, and will follow up after I get > back from vacation. > Cool. No hurry, I have plenty of other stuff to clean up in autodoc and work to do to make it non-contrib specific. Have a great vacation! Tom --~--~-~--~~~---~--~~ You

Re: binding and bundles of variables

2009-08-08 Thread Meikel Brandmeyer
Hi, Am 08.08.2009 um 15:52 schrieb Rich Hickey: get-/push-/pop-thread-bindings wrapping Var.get/push/popThreadBindings would be a welcome issue/patch. Note the addition of getThreadBindings(), which returns a map of all the current bindings. This could be used to define a function-returning ma

Re: Question about pmap

2009-08-08 Thread Nicolas Oury
Hi Brad, I think that there is no global lock for heap allocation, at least for small objects. As a support for this claim: http://www.ibm.com/developerworks/java/library/j-jtp09275.html (see more specifically: "Thread-local allocation", but the article is really interesting as a whole.) I am

Re: Question about pmap

2009-08-08 Thread Bradbev
> I'm not sure how to determine why calling 'new Double' each time > through NewDoubleTest's inner loop causes 2 threads to perform not > much better than 1.  The best possible explanation I've heard is from > Nicolas Oury -- perhaps we are measuring the bandwidth from cache to > main memory, not

Re: Durable transactions in practice?

2009-08-08 Thread John Harrop
On Sat, Aug 8, 2009 at 2:50 AM, cody koeninger wrote: > > Assuming people aren't patching clojure ala dave griffith's external > transactions patch in the group files, what are people doing in > practice to durably store the state of refs? > > Storing within a transaction and somehow ensuring you

Re: Clojure performance tests and clojure a little slower than Java

2009-08-08 Thread John Harrop
On Fri, Aug 7, 2009 at 9:19 PM, Andy Fingerhut < andy_finger...@alum.wustl.edu> wrote: > > What I suggest is > > > > (loop [zr (double 0.0) > >zi (double 0.0) > >i (int (inc iterations-remaining))] > > (let [zr2 (* zr zr) > > zi2 (* zi zi)] > > (if (and (not (= 0 i))

Re: seq-utils testing reveals potential flatten bugs

2009-08-08 Thread Sean Devlin
My thought we to use the test cases as a specification for the desired behavior. 1. Assume that the following case is desired behavior [:a 1 2 :b 3] [[:a [1 2]] [:b 3]] My thought was that "If it's a seq, flatten it". That lead me to develop the test case above. Here's how it works explicit

Re: Current API doc (for HEAD)

2009-08-08 Thread Rich Hickey
On Fri, Aug 7, 2009 at 2:41 AM, Tom Faulhaber wrote: > >> Tom, are you amenable? > > Yup, happy to. Where should it go? > > I'm generating real html now, not wiki-text (for a bunch of reasons, > among them the ability to download a tree and use your browser > offline, old version support, etc.), s

Re: binding and bundles of variables

2009-08-08 Thread Rich Hickey
On Sat, Aug 8, 2009 at 5:53 AM, Meikel Brandmeyer wrote: > Hi, > > Am 08.08.2009 um 02:52 schrieb samppi: > >> Great, thanks. Is clojure.lang.Var/pushThreadBindings a public, >> supported part of the API? Can I use it without fear of suddenly >> dropped support? > > It is was `binding` uses intern

Re: Question about pmap

2009-08-08 Thread Andy Fingerhut
Johann, if you are still following this thread, could you try running this Clojure program on your 8 core machine? http://github.com/jafingerhut/clojure-benchmarks/blob/3e45bd8f6c3eba47f982a0f6083493a9f076d0e9/misc/pmap-testing.clj These first set of parameters below will do 8 jobs sequentially,

Re: seq-utils testing reveals potential flatten bugs

2009-08-08 Thread Meikel Brandmeyer
Hi, Am 08.08.2009 um 07:36 schrieb Sean Devlin: In my opinion, flatten to behave more like this: http://gist.github.com/164291 May I ask a stupid question? What is the use of this case: [:a 1 2 :b 3] {:a [1 2] :b 3} Wouldn't it be more useful to flatten only depending on the outer

Re: combining methods

2009-08-08 Thread Meikel Brandmeyer
Hi, Am 07.08.2009 um 20:55 schrieb Andy Chambers: Does clojure have an equivalent of either CLOS's `call-next-method' or java's super? You can use get-method. (derive ::Foo ::Bar) (derive ::Foo ::Frob) (defmulti do-something type) (defmethod do-so

Re: binding and bundles of variables

2009-08-08 Thread Meikel Brandmeyer
Hi, Am 08.08.2009 um 02:52 schrieb samppi: Great, thanks. Is clojure.lang.Var/pushThreadBindings a public, supported part of the API? Can I use it without fear of suddenly dropped support? It is was `binding` uses internally. Unfortunately this is not exported by Clojure's public API. I - unf

Re: enhancement request: a simple way to read a file

2009-08-08 Thread Albert Cardona
Daniel Lyons wrote: > On Aug 7, 2009, at 12:19 PM, Albert Cardona wrote: > >> Currently, one must resort to incantations like: >> >> (with-open [stream (java.io.BufferedReader. >> (java.io.FileReader. >> "/home/albert/test.xml"))] >> (doseq [line (line

Re: Clojure performance tests and clojure a little slower than Java

2009-08-08 Thread Mark Engelberg
On Fri, Aug 7, 2009 at 5:14 PM, John Harrop wrote: >     (if (and (not (= 0 i)) (< (+ zr2 zi2 limit-square))) I believe that (zero? i) is faster than (= 0 i). --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure"