Re: noob question about try/catch

2013-04-27 Thread Neale Swinnerton
On Fri, Apr 26, 2013 at 5:55 PM, Michael Gardner I believe Clojure is wrapping the java.sql.SQLException in a java.lang.RuntimeException because of reasons[1][2], so you'd need to catch java.lang.RuntimeException and examine the exception's cause property to get the real exception. Agree

Re: (pprint template) gives me an exception

2013-04-27 Thread Gary Verhaegen
Most probably, your template is a lazy seq and pprint forces its evaluation, which is why the error happens at the pprint point. On 17 April 2013 08:33, Tassilo Horn t...@gnu.org wrote: larry google groups lawrencecloj...@gmail.com writes: (println (pp/pprint template)) Aside from the

Re: Reducers newbie question

2013-04-27 Thread Stanislav Yurin
Yep, thanks, my bad. I got the point. Actually, what I was trying to do, is to prototype multithreaded i/o operation via reducers. And then use fold to regulate number of concurrent operations. But now something tells me I am doing not very clever thing. On Friday, April 26, 2013 5:27:46 PM

Re: Reducers newbie question

2013-04-27 Thread Alan Busby
On Sat, Apr 27, 2013 at 7:35 PM, Stanislav Yurin jusk...@gmail.com wrote: Actually, what I was trying to do, is to prototype multithreaded i/o operation via reducers. And then use fold to regulate number of concurrent operations. But now something tells me I am doing not very clever thing.

Re: Reducers newbie question

2013-04-27 Thread Stanislav Yurin
Thanks Alan, looking into it. By the way, fold function has [n combinef reducef coll] implementation, where n is number of elements collection is folded by. 512 is just the default. On Saturday, April 27, 2013 3:51:39 PM UTC+3, Alan Busby wrote: On Sat, Apr 27, 2013 at 7:35 PM, Stanislav

Re: Reducers newbie question

2013-04-27 Thread Alan Busby
On Sat, Apr 27, 2013 at 10:01 PM, Stanislav Yurin jusk...@gmail.com wrote: By the way, fold function has [n combinef reducef coll] implementation, where n is number of elements collection is folded by. 512 is just the default. Yep I misspoke there, but it is still one of the tricks to be

Re: Reducers newbie question

2013-04-27 Thread Stanislav Yurin
Indeed, that was my really bad example with 100. On Saturday, April 27, 2013 4:19:07 PM UTC+3, Alan Busby wrote: On Sat, Apr 27, 2013 at 10:01 PM, Stanislav Yurin jus...@gmail.comjavascript: wrote: By the way, fold function has [n combinef reducef coll] implementation, where n is

Parallel let form

2013-04-27 Thread Glen Mailer
Hi All, I was recently looking at how to make better use of parallelisation for simple tasks in my compojure app, I had a construction similar to the following: (views/some-view (api/api-call-1) (api/api-call-2) (api/api-call-3)) It seemed that the easiest way to introduce some parallelism

Re: Parallel let form

2013-04-27 Thread Ben Wolfson
guv is broken if your let form introduces bindings that depend on earlier bindings: user= (plet [a 2 b a] b) CompilerException java.lang.RuntimeException: Unable to resolve symbol: a in this context, compiling:(NO_SOURCE_PATH:1) user= (clojure.pprint/pprint (macroexpand-1 '(plet [a 2 b a] b)))

Re: Parallel let form

2013-04-27 Thread Ben Wolfson
It's not too hard, though, to write a plet form that first does some analysis on the bindings to see which of them depend on which others. I believe I mentioned this elsewhere in the group as an example of why a macro might want to macroexpand its arguments, because doing that is the simplest way

Re: Something like cond, but with test-fns

2013-04-27 Thread Gary Verhaegen
On 22 April 2013 16:29, Ken Scambler ken.scamb...@gmail.com wrote: Learned a lot from your version though, thanks! I'm still yet to memorize all the useful combinators in the library. If, like me, you can't memorize long lists of vocabulary by just reading them, I would suggest you to try

Re: Parallel let form

2013-04-27 Thread Alan Busby
Hi All, You may want to take a look at Prismatic's graph library, it does what you've described above in a slightly different way. Link: https://github.com/Prismatic/plumbing On Sun, Apr 28, 2013 at 1:04 AM, Ben Wolfson wolf...@gmail.com wrote: It's not too hard, though, to write a plet form

why is load-file in nrepl not getting jsoup?

2013-04-27 Thread larry google groups
I am in emacs, in an nrepl session, and I do this: user (load-file /Users/lkrubner/projects/tma2/cacher/src/cacher/core.clj) ClassNotFoundException org.jsoup.Jsoup java.net.URLClassLoader$1.run (URLClassLoader.java:366) Why do I get that error? The file starts like this: (ns

Re: Parallel let form

2013-04-27 Thread Ben Wolfson
That library and others like it (e.g., oh, I dunno, babbage) impose more overhead, though, than a simple let form, if you just want to use something one-off in one place. On Sat, Apr 27, 2013 at 5:05 PM, Alan Busby thebu...@thebusby.com wrote: Hi All, You may want to take a look at

Re: why is load-file in nrepl not getting jsoup?

2013-04-27 Thread Michael Klishin
2013/4/28 larry google groups lawrencecloj...@gmail.com Why do I get that error? Did you restart nREPL after adding the JSoup dependency? -- MK http://github.com/michaelklishin http://twitter.com/michaelklishin -- -- You received this message because you are subscribed to the Google

Now *there*'s a machine made for Clojure.

2013-04-27 Thread Cedric Greevey
https://en.wikipedia.org/wiki/Intel_MIC 50+ cores?! Clojure will leave every other language in the dust on something like that, thanks to its inherently scaleable concurrency constructs. Try writing a 50-threaded Java application without getting deadlocks all over the place, or cheating and using

Re: Now *there*'s a machine made for Clojure.

2013-04-27 Thread Yves S. Garret
How would this compare to Erlang? On Sat, Apr 27, 2013 at 10:51 PM, Cedric Greevey cgree...@gmail.com wrote: https://en.wikipedia.org/wiki/Intel_MIC 50+ cores?! Clojure will leave every other language in the dust on something like that, thanks to its inherently scaleable concurrency

Re: Now *there*'s a machine made for Clojure.

2013-04-27 Thread Cedric Greevey
On Sat, Apr 27, 2013 at 11:13 PM, Yves S. Garret yoursurrogate...@gmail.com wrote: How would this compare to Erlang? On Sat, Apr 27, 2013 at 10:51 PM, Cedric Greevey cgree...@gmail.comwrote: https://en.wikipedia.org/wiki/Intel_MIC 50+ cores?! Clojure will leave every other language in

Re: Now *there*'s a machine made for Clojure.

2013-04-27 Thread Yves S. Garret
I'll take a blind stab at this and say that Erlang might actually do more poorly, unless the chip's interchip message passing is taken advantage of by Erlang. If there's a separate piece of hardware taking on the role of being the messenger, having to waste computer cycles to send a message isn't

Re: Now *there*'s a machine made for Clojure.

2013-04-27 Thread Timothy Baldridge
The biggest issue with these sort of chips (this design is known as the Intel Xeon Phi) is memory. 50+ cores sharing the same memory bus means that cache miss penalties go through the roof. And unless these chips are optimized for efficient CAS operations that can be a issue as well. See for

Re: Now *there*'s a machine made for Clojure.

2013-04-27 Thread Cedric Greevey
On Sat, Apr 27, 2013 at 11:23 PM, Yves S. Garret yoursurrogate...@gmail.com wrote: I'll take a blind stab at this and say that Erlang might actually do more poorly, unless the chip's interchip message passing is taken advantage of by Erlang. If there's a separate piece of hardware taking on

Re: Now *there*'s a machine made for Clojure.

2013-04-27 Thread Lee Spector
I don't want to be too much of a downer, but our experience running Clojure on 48-core machines was pretty depressing, with our speedups often being near zero or even negative (that is, running on 48 cores can be slower than running on 1, for a task that would seem to be a good candidate for

[ANN] stories - bdd lib for clojure

2013-04-27 Thread Steven Degutis
https://github.com/sdegutis/stories It looks and works a lot like cucumber. But more clojure-y. Write tests at a super-high level. Test by observing side-effects. -Steven -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group,

Re: Now *there*'s a machine made for Clojure.

2013-04-27 Thread Timothy Baldridge
E-mail thread had less to do with issues of Clojure per se, but more with issues the JVM had running on a 48-way machine. Or am I missing something? IIRC the Azul people played with Clojure a bit, I wonder if their suped-up JVM allows Clojure to perform any better. Timothy On Sat, Apr 27, 2013

Re: Now *there*'s a machine made for Clojure.

2013-04-27 Thread Cedric Greevey
On Sat, Apr 27, 2013 at 11:36 PM, Lee Spector lspec...@hampshire.eduwrote: I don't want to be too much of a downer, but our experience running Clojure on 48-core machines was pretty depressing, with our speedups often being near zero or even negative (that is, running on 48 cores can be

Re: [ANN] stories - bdd lib for clojure

2013-04-27 Thread Steven Degutis
I'd put it on Clojars but I can't really figure out how to deal with this gpg stuff. Seems way more complicated. Wish clojure had something easier, like homebrew and melpa. But whatever. On Saturday, April 27, 2013 11:20:25 PM UTC-5, Steven Degutis wrote: https://github.com/sdegutis/stories