Logo

Programming-Idioms

History of Idiom 2 > diff from v15 to v16

Edit summary for version 16 by :

Version 15

2015-09-05, 16:24:22

Version 16

2015-10-25, 19:10:31

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
lists:foreach(
  fun(_) ->
    io:format("Hello~n")
  end, lists:seq(1, 10)).
Doc URL
http://erldocs.com/current/stdlib/lists.html?i=0&search=lists:for#foreach/2
Demo URL
http://tryerl.seriyps.ru/#id=2ff3