Logo

Programming-Idioms

History of Idiom 2 > diff from v11 to v12

Edit summary for version 12 by :

Version 11

2015-09-03, 13:30:06

Version 12

2015-09-03, 13:30:16

Idiom #2 Print Hello 10 times

Loop to execute some code a constant number of times

Idiom #2 Print Hello 10 times

Loop to execute some code a constant number of times

Code
(dotimes [_ 10]
  (println "Hello"))
Code
(dotimes [_ 10]
  (println "Hello"))
Comments bubble
The character "_" means we don't want to bind the value to a symbol.
Comments bubble
The character _ means we don't want to bind the value to a symbol.
Doc URL
http://clojuredocs.org/clojure.core/dotimes
Doc URL
http://clojuredocs.org/clojure.core/dotimes