Dodatkowe przykłady dopasowywane są do haseł w zautomatyzowany sposób - nie gwarantujemy ich poprawności.
Moreover, C++11 allows foreach loops to be applied to any class that provides the and functions.
Ada supports foreach loops as part of the normal for loop.
NVelocity is supplied with simple control blocks such as if statements and foreach loops.
Go's foreach loop can be used to loop over an array, slice, string, map, or channel.
ActionScript supports foreach loops by key/index and by value:
Foreach loops, called Fast enumeration, are supported starting in Objective-C 2.0.
Since OCaml is a functional language, the equivalent of a foreach loop can be achieved as a library function over lists and arrays.
Qt, a C++ framework, offers a macro providing foreach loops using the STL iterator interface:
Python's tuple assignment, fully available in its foreach loop, also makes it trivial to iterate on (key, value) pairs in associative arrays:
Here, when is a Boolean value then the section tag acts like an if conditional, but when is an array then it acts like a foreach loop.
Unlike other for loop constructs, however, foreach loops usually maintain no explicit counter: they essentially say "do this to everything in this set", rather than "do this 'x' times".
Some notable differences between D and C in the area of imperative programming include D's foreach loop construct, which allows looping over a collection, and nested functions, which are functions that are declared inside of another and may access the enclosing function's local variables.