loop – What is the difference between FOR and DOSEQ in clojure

What is the difference between is Y doseq?

I have written a program that gives me the greatest value within the parameters reported. Obs: I know that the function exists max Y max-keybut I do not want to use them because I want to train the language.

Example:

use doseq, works.

(defn Maximum value [& num]
  (and a lot [x (atom (first num))]
    (doseq [i num] (when (> i @x) (reset! x i))) @x))

use is, it does not work.

(defnMaximum2 [& num]
  (and a lot [x (atom (first num))]
    (by [i num :when (> i @x)] (reset! x i)) @x))