I knew I was missing something...!! Thanks all for your help! :)
On Aug 27, 12:19 am, Scott Moonen wrote:
> Hi Soura. I think you have an extra set of parentheses in your second
> example, on the line with dosync. It should read:
>
> (defn foo2 [n]
> (let [r (ref n)]
> #(dosync
> (a
Hi Soura. I think you have an extra set of parentheses in your second
example, on the line with dosync. It should read:
(defn foo2 [n]
(let [r (ref n)]
#(dosync
(alter r + %) @r)))
-- Scott
On Wed, Aug 26, 2009 at 2:40 PM, Sourav wrote:
>
> Hi,
>
> I'm new to clojure and came fr
(defn foo2 [n]
(let [r (ref n)]
#(dosync (alter r + %) @r)))
Something went wrong, I am resending the code.
Regards,
Emeka
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send
On Wed, Aug 26, 2009 at 6:40 PM, Sourav wrote:
>
> Hi,
>
> I'm new to clojure and came from a Lisp background. While learning I
> clojure I came accross the two different ways of creating anonymous
> functions ((fn ...) and #(...)). I tried to construct the accumulator
> function in clojure using
Hi,
Am 26.08.2009 um 20:40 schrieb Sourav:
(defn foo2 [n]
(let [r (ref n)]
#((dosync
(alter r + %) @r
One pair of parentheses too much...
(defn foo2
[n]
(let [r (ref n)]
#(dosync (alter r + %
What you wrote is #((foo)) which translates to (fn [] ((
Hi,
I'm new to clojure and came from a Lisp background. While learning I
clojure I came accross the two different ways of creating anonymous
functions ((fn ...) and #(...)). I tried to construct the accumulator
function in clojure using these forms and this is what I wrote (this
might seem naive