title: Sum of squares in Clojure
body: <p>I have to do a short presentation of the Clojure language and in it I must also supply the solution for the simple task: <strong>Input an integer number n and output the sum: 1+2^2+3^2+...+n^2. Use input validation for n to be positive.</strong></p>
  
  <p>I have zero previous xp with Lisp dialects or Java and I find this kind of challenging. How far off am I? (guessing a LOT):</p>
  
  <pre><code>(defn sum_of_squares [n]
  (if (&gt; n 0)
      (def sum 0)
      (dotimes [n]
          (+ sum (* n n)))))
  </code></pre>
  
  <p>As you can see I have no idea what's going on. How should I actually prompt the user to enter the value of <strong>n</strong> and later <strong>println</strong> the total sum? Also where is the whole <strong>(+ sum (* n n)</strong> expression supposed to store it's result, updating sum in the process?</p>
  
  <p>Maybe there's a LOT simpler way of solving this problem, so feel free to show me : ).</p>