miércoles, 12 de agosto de 2015

My first function in clojure

This a simple recursive countdown, but in clojure is more interesting. This is the code:
(defn countdown [x]
 (if (zero? x)
  (do 
   :blastoff!
   (println "Zero")
  )
  (do
   (println x)
   (recur (dec x))
  )
 ) 
)

No hay comentarios:

Publicar un comentario