Jump to content

Loops/Foreach: Difference between revisions

m
(Added Dyalect programming language)
Line 798:
}</lang>
 
This code would work for any type that has a method "iter" (which returnsreturning an iterator). In fact a runtime environment silently callcalls this method for you here and creates an iterator out of an array. The code above is absolutely identical to:
 
<lang Dyalect>for i in [1,2,3].iter() {
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.