Logo

Programming-Idioms

  • Erlang
  • Ada
for Item of Items loop
   Do_Something (Item);
end loop;
lists:foreach(fun do_something/1, Items).
[do_something(X) || X <- Items]
for (size_t i = 0; i < sizeof(items) / sizeof(items[0]); i++) {
	DoSomethingWith(&items[i]);
}

sizeof the array divided by the size of the first element computes the number of elements, often defined as macro ARRAY_SIZE

New implementation...