Logo

Programming-Idioms

  • Erlang
  • Groovy
for(x in items) doSomething(x)
items.each { doSomething(it) }

If a closure has only one parameter, it can be omitted and defaults to the name it
items.each { x -> doSomething(x) }
lists:foreach(fun do_something/1, Items).
[do_something(X) || X <- Items]
for Item of Items loop
   Do_Something (Item);
end loop;

New implementation...