Re: bounded memoize

2010-03-16 Thread Meikel Brandmeyer
Hi, as threatened previously I wrote a summery blog post of this discussion: http://kotka.de/blog/2010/03/memoize_done_right.html. Please let me know in case I missed something crucial. I'm also working on a protocol/type based implementation here: http://paste.pocoo.org/show/190179. More to come

Re: Long-running STM updates will never complete... is there a solution?

2010-03-16 Thread Christophe Grand
On Mon, Mar 15, 2010 at 11:24 PM, Garth Sheldon-Coulson wrote: > Christophe, thanks for the partial memoization tip. I think that would > work in many cases, but for my current use case I really need to put a > lock on the ref, because the function is very expensive and other > threads will be upd

Re: Long-running STM updates will never complete... is there a solution?

2010-03-16 Thread Christophe Grand
Hi Chouser, On Mon, Mar 15, 2010 at 11:27 PM, Chouser wrote: > I make no claims about the Rightness of this suggestion, but > simply offer another example of a work-around: > >(dosync (alter r identity) (alter r f)) > > That is, a "dummy write" via alter is also sufficient to allow > the tra

Why do functions in the state monad only accept one value?

2010-03-16 Thread Steven E. Harris
I've been comparing the definition of the Clojure's state monad -- state-m in clojure.contrib.monads -- to definitions I've found elsewhere, and there's a facet of the Clojure definition that's puzzling: Why do monadic functions in state-m only accept one argument (a "basic value") and return a mon

Re: Why do functions in the state monad only accept one value?

2010-03-16 Thread Jarkko Oranen
> What would be lost by defining Clojure bind operator like this: > >   (fn m-bind-state [mv f] >     (fn [s] >       (let [[v ss] (mv s)] >         (f v ss > > Is there more to it than, "Monadic functions must return monadic > values. My first thought was that it would be problematic for the

Re: Why do functions in the state monad only accept one value?

2010-03-16 Thread Jarkko Oranen
*facepalm* I should've known GG was just hiding the post from me. -- 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 you

Re: Why do functions in the state monad only accept one value?

2010-03-16 Thread Jarkko Oranen
> Is there more to it than, "Monadic functions must return monadic > values"? > > Any clarifying advice would be welcome. > Gah, I already wrote a reply, but looks like I lost it somehow. To summarise: I think one of the main benefits of the monad abstraction is the uniformity of all monads. ie.

Re: Vimclojure Performance on Windows

2010-03-16 Thread Emeka
Meikel, Is Vimclojure stable enough to have it on my Window's Vista? I tried it out before without success. Regards, Emeka On Fri, Feb 26, 2010 at 6:22 AM, Meikel Brandmeyer wrote: > Hi, > > On Feb 25, 4:46 pm, Vitaly Peressada wrote: > > > Installed vimclojure-2.1.2 on Windows XP SP3. Have d

Re: Interest in Google Summer of Code 2010?

2010-03-16 Thread Jonathon Klobucar
Did Clojure ever submit to GSoC for 2010? On Feb 14, 11:59 am, Vivek Khurana wrote: > On Feb 14, 11:27 am, Vivek Khurana wrote: > > >  I had moved to Clojure recently. I had been GSoC mentor twice and I > > have the t-shirt to prove it ;-) . If clojure is accepted in GSoC, I > > will be happy to

[Newbie] leiningen and random jars

2010-03-16 Thread stevel
I'd really like to use leiningen to assemble my classpath for me, but need to reference a jdbc jar. What is the approved method of doing this? -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.co

Web Programming with clojure

2010-03-16 Thread Tim Johnson
My niche currently is web programming and web interfaces. I have not used java and I have a certain comfort level with lisp dialects. I use emacs 22.3.1 on slackware 13.0 32-bit. Therefore clojure is of interest to me. I would welcome links to discussions, resources etc. on this topic. Thanks --

Re: Long-running STM updates will never complete... is there a solution?

2010-03-16 Thread Chouser
On Tue, Mar 16, 2010 at 5:25 AM, Christophe Grand wrote: > On Mon, Mar 15, 2010 at 11:27 PM, Chouser wrote: >> >> I make no claims about the Rightness of this suggestion, but >> simply offer another example of a work-around: >> >>    (dosync (alter r identity) (alter r f)) >> >> That is, a "dummy

Re: Web Programming with clojure

2010-03-16 Thread David Nolen
On Mon, Mar 15, 2010 at 3:11 PM, Tim Johnson wrote: > My niche currently is web programming and web interfaces. I have not > used java and I have a certain comfort level with lisp dialects. > I use emacs 22.3.1 on slackware 13.0 32-bit. > > Therefore clojure is of interest to me. > I would welcom

Re: [Newbie] leiningen and random jars

2010-03-16 Thread David Nolen
On Tue, Mar 16, 2010 at 12:22 PM, stevel wrote: > I'd really like to use leiningen to assemble my classpath for me, but > need to reference a jdbc jar. > What is the approved method of doing this? > You should put your jar into the lib directory of your project folder. You can customize this but

Re: Web Programming with clojure

2010-03-16 Thread Angel Java Lopez
Hi people! I'm not use it, but first link to explore http://github.com/weavejester/compojure My collected links http://delicious.com/ajlopez/compojure http://delicious.com/ajlopez/clojure+webdevelopment Angel "Java" Lopez http://www.ajlopez.com http://twitter.com/ajlopez On Mon, Mar 15, 2010 at

Re: Why do functions in the state monad only accept one value?

2010-03-16 Thread Michał Marczyk
A major part of the "point" behind monads is that they can hide some implicit parameter passing. In the case of State, the implicit parameter is the current state and it is passed "inside" the bind operator. Haskell is no different from Clojure on this point: a State-using programme builds up a sta

Re: [Newbie] leiningen and random jars

2010-03-16 Thread Phil Hagelberg
On Tue, Mar 16, 2010 at 9:22 AM, stevel wrote: > I'd really like to use leiningen to assemble my classpath for me, but > need to reference a jdbc jar. > What is the approved method of doing this? The best way to do it would be to push it to a public repository so everyone on your team can have ac

Re: Vimclojure Performance on Windows

2010-03-16 Thread Meikel Brandmeyer
Hi, On Tue, Mar 16, 2010 at 07:01:38PM +, Emeka wrote: > Is Vimclojure stable enough to have it on my Window's Vista? I tried it out > before without success. I have a stable setup on Windows XP. I can't tell for Vista but I would not expect any problems beyond the usual Windows annoyances.

Re: Web Programming with clojure

2010-03-16 Thread Tim Johnson
* David Nolen [100316 12:12]: > On Mon, Mar 15, 2010 at 3:11 PM, Tim Johnson wrote: > > > My niche currently is web programming and web interfaces. I have not > > used java and I have a certain comfort level with lisp dialects. > > I use emacs 22.3.1 on slackware 13.0 32-bit. > > > > Therefore c

Re: Why do functions in the state monad only accept one value?

2010-03-16 Thread Steven E. Harris
Jarkko Oranen writes: [...] > This way, you can write a function that works under many different > monads, as long as it uses the generic facilities to return monadic > values. eg. a lifted inc: > > (defn m-inc [v] > (m-result (inc v)) > > which can be used in the state monad as an argument to

Re: Why do functions in the state monad only accept one value?

2010-03-16 Thread Steven E. Harris
Michał Marczyk writes: > a State-using programme builds up a stateful computation first, then > uses runState (or perhaps execState / evalState) to run it as a whole; > only at this final step does the initial state actually get poured > into the opening of the monadic pipe, as it were. That's a

Re: Web Programming with clojure

2010-03-16 Thread Matt
There's also Conjure which is a Rails like framework for Clojure. It includes everything you need, templating with clj-html, persistence with clj-record, and Ring to bind them all. You can find it on Github at: http://github.com/macourtney/Conjure I've added considerable documentation on the wiki

Re: Web Programming with clojure

2010-03-16 Thread Tim Johnson
* Matt [100316 17:16]: > There's also Conjure which is a Rails like framework for Clojure. It > includes everything you need, templating with clj-html, persistence > with clj-record, and Ring to bind them all. > > You can find it on Github at: http://github.com/macourtney/Conjure > > I've added

Re: Web Programming with clojure

2010-03-16 Thread Wilson MacGyver
there is a good screencast that deal with compojure + emacs. http://www.bestinclass.dk/index.php/2009/12/dynamic-interactive-webdevelopment/ compujure is a route based webframework, very much like ruby's sinatra. I figure with your emacs background, this will feel very much at home. On Mon, Mar

Re: take-to-first & partition-when

2010-03-16 Thread Greg Fodor
Just saw that I need to sign the contributor agreement. Will do promptly. I additionally have implemented two new functions that I believe could fit in clojure-contrib.seq and clojure- contrib.combinatorics. The seq function partition-at-fenceposts allows you to partition a seq based upon bits flip

Re: Web Programming with clojure

2010-03-16 Thread Tim Johnson
* Wilson MacGyver [100316 18:17]: > there is a good screencast that deal with compojure + emacs. > > http://www.bestinclass.dk/index.php/2009/12/dynamic-interactive-webdevelopment/ > > compujure is a route based webframework, very much like ruby's sinatra. > > I figure with your emacs backgroun

Re: Why do functions in the state monad only accept one value?

2010-03-16 Thread Konrad Hinsen
On 17.03.2010, at 00:17, Steven E. Harris wrote: > Ah, but here's where part of my confusion arises. With this treatment of > such a built-up computation, it's a kind of a zero-argument function, in > that there's no way to pass in a "basic value" to kick it off. Where > does the first "basic valu