Logo

Programming-Idioms

  • Ada
  • Go
for _, x := range items {
    doSomething(x)
}

You have to explicitly ignore the index loop variable, with the blank identifier _
for Item of Items loop
   Do_Something (Item);
end loop;
for (unsigned int i = 0 ; i < items_length ; ++i){
        Item* x = &(items[i]);
	DoSomethingWith(x);
}

items_length type is: unsigned int
DoSomethingWith prototype is: void DoSomethingWith(Item*);

New implementation...