Max Gap Function

This is a smaller project where you take a list of numbers, sort them, and find the biggest gap between two numbers.

(defn max-gap [L]
  (loop [X (sort L) N -1]
    (cond (= (count X) 1) N
      (> (- (first (rest X)) (first X)) N) 
      (recur (rest X) (- (first (rest X)) (first X)))
      :else (recur (rest X) N))))

(println (max-gap [1 2 3 4 5 6 7 8 9 4 6 3 3 15 2 6 1 7 4]))