Re: temp variables best practice

2009-09-12 Thread Scott Moonen
Terrance, you could do something like this (loose on the syntax): (def final-foo (let [tmpString (. javax.swing.JOptionPane showInputDialog "What is your foobar?")] (. Double parseDouble tmpString))) Look at this comment for one example of a function written both ways: http://lojic.com/blog

Re: A little help needed in understnding anonymous functions

2009-08-26 Thread Scott Moonen
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