title: How to run clojure program from terminal
body: <p>I have just begun learning clojure and I'm using the Textmate editor for writing the scripts. However, I am not able to figure out how to run it from the terminal. Like I type the clj filename.clj command but nothing happens. Do I need to include the function name also somewhere because I have a function that takes a number as an argument. </p>
  
  <p>Here is my code that I want to run from the terminal:</p>
  
  <pre><code>(defn next-collatz-num [n]
  
  
  (if (even? n)
      (quot n 2)
      (inc (* n 3))))
  
  (defn collatz [n]
    (take-while #(&lt; 1 %)(iterate next-collatz-num n)))
  
  (defn max-count-collatz [n]
    (when (&gt; n 0)
      (first
        (reduce
          #(if (&gt; (last %1)(last %2)) %1 %2)
            [1 1] (map #(list % (count (collatz %))) (range 1 (inc n)))))))
  
  (max-count-collatz 999999)
  </code></pre>