Re: Ensure

2010-03-14 Thread Meikel Brandmeyer
Hi, On Mar 15, 6:47 am, Mark Engelberg wrote: > What's a minimal example that demonstrates when ensure is necessary? Ok. Maybe a little grotesque and not 100% valid, but it should get across the idea. (dosync (when (= @reactor-state :off) (alter reactor-door open))) Once every 100 years

Re: Ensure

2010-03-14 Thread Michał Marczyk
On 15 March 2010 06:47, Mark Engelberg wrote: > What's a minimal example that demonstrates when ensure is necessary? Here's a link to my posting to an earlier thread with a minimal example of how ensure is different from deref: http://groups.google.com/group/clojure/msg/8e477df4b5cf418e Is this

Re: Newbie question: Why does clojure prefer java.lang.Exception?

2010-03-14 Thread ataggart
Exceptions are over/mis-used in java, particularly checked exceptions (runtime exceptions aren't so bad). My sense is that those places where java.lang.Exception is thrown, the exception is not expected to be handled by user code, or perhaps more accurately, a direct result of a bug fat-fingered i

Ensure

2010-03-14 Thread Mark Engelberg
What's a minimal example that demonstrates when ensure is necessary? -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with

Re: Clojure discuss

2010-03-14 Thread Mike Mazur
Hi, On Mon, Mar 15, 2010 at 07:21, Ulrich VACHON wrote: > Very interesting interview of Stuart Halloway about Clojure by Sadek > Drobi available on QCon website. Did you forget the link? http://www.infoq.com/interviews/stuart_holloway_clojure Mike -- You received this message because you are

Clojure discuss

2010-03-14 Thread Ulrich VACHON
Hello, Very interesting interview of Stuart Halloway about Clojure by Sadek Drobi available on QCon website. Enjoy, Ulrich VACHON -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that

Re: A Tour of Enlive

2010-03-14 Thread David Nolen
On Sun, Mar 14, 2010 at 3:45 PM, Ludovic Kuty wrote: > This is great. Thanks. > > Some typos: > > lien instead of lein in "Install Leiningen" section: "I truly envy the > new Clojurians who do not know the dark times before lien repl and > lein swank :)" > laod instead of load in tutorial.scrape3=

Re: A Tour of Enlive

2010-03-14 Thread Ludovic Kuty
This is great. Thanks. Some typos: lien instead of lein in "Install Leiningen" section: "I truly envy the new Clojurians who do not know the dark times before lien repl and lein swank :)" laod instead of load in tutorial.scrape3=> (laod "scrape3") On Mar 14, 7:23 pm, Richard Newman wrote: > > I

Re: A Tour of Enlive

2010-03-14 Thread Richard Newman
I just finished up a fairly involved tour of Enlive. Great stuff, thank you for sharing. If I have any comments as I walk through, I'll send them along. -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@

A Tour of Enlive

2010-03-14 Thread David Nolen
I just finished up a fairly involved tour of Enlive. I think that Enlive is a truly fantastic library that just needs a little more documentation ;) I cover scraping Hacker News and the New York Times as well three templating examples that use Compojure. I also show how "template inheritance", cons

"Are we there yet ?" retranscription

2010-03-14 Thread Ludovic Kuty
Hi everybody, I've just made a retranscription of Rich Hickey's "Are we there yet ?" keynote. I think this is really an important and interesting keynote where a lot of key concepts are presented. And it can take time to fully understand them all. A text format can help here I think. You can get

Re: bounded memoize

2010-03-14 Thread Christophe Grand
On Sun, Mar 14, 2010 at 2:06 PM, Eugen Dück wrote: > I wonder whether we can make any statement about the likeliness of > this happening in memoize6/7 vs. memoize7-variant or your memoize8, > although it's unlikely to occur in all scenarios so far that I've > wanted to use memoize in. > Anyway d

Re: bounded memoize

2010-03-14 Thread Eugen Dück
On Mar 14, 7:59 pm, Christophe Grand wrote: > Well the fn passed to swap! can be retried so in case of "bad luck" you'll > still create several delays. You're absolutely right! I wonder whether we can make any statement about the likeliness of this happening in memoize6/7 vs. memoize7-variant or

Re: bounded memoize

2010-03-14 Thread Christophe Grand
Hi Meikel, On Sun, Mar 14, 2010 at 9:42 AM, Meikel Brandmeyer wrote: > > I agree: it can be concurrently computed several times (but a given > thread > > would only compute it at most once). > > On Sun, Mar 14, 2010 at 01:26:10AM +0100, Christophe Grand wrote: > I must confess I was a little ins

Re: bounded memoize

2010-03-14 Thread Christophe Grand
Hi Eugen! On Sun, Mar 14, 2010 at 6:51 AM, Eugen Dück wrote: > your fifo-strategy (the one that uses "identity" as the hit method) > does not work: > > user=> (def g (memoize7 identity (fifo-strategy 3))) > #'user/g > user=> (g 1) > 1 > user=> (g 1) > java.lang.IllegalArgumentException: Wrong nu

Re: bounded memoize

2010-03-14 Thread Eugen Dück
On Mar 14, 5:42 pm, Meikel Brandmeyer wrote: > really shows, that concurrent programming is not trivial. Not even for > „trivial“ things like a memoised function. True. It's not too hard to be correct, but being correct and performant at the same time is a different issue... Thinking about your

Re: bounded memoize

2010-03-14 Thread Meikel Brandmeyer
Hi, On Sun, Mar 14, 2010 at 01:26:10AM +0100, Christophe Grand wrote: > I agree: it can be concurrently computed several times (but a given thread > would only compute it at most once). I must confess I was a little insisting on a point which has probably only little impact in the real life. But