title: If statement with comparison
body: <p>I am trying to do a comparison to find the largest number in a list. I know I could just use the (max 1 2 4 3) but I'm trying to write the function myself. However, I'm not too sure where the error is. Whenever I run this, the maximum is always 2. Am I doing a comparison wrong somewhere or forget something?</p>
  
  <pre><code>(defn maxVal [list]
    (def maxValue 0)
  
    (doseq [x list]
      (println x maxValue)
      (if &gt; x maxValue)
        (do (println x "&gt;" maxValue)
            (def maxValue x)))
      (var-get #'maxValue))
  
  (maxVal '(1 4 3 2))
  </code></pre>