eg a function to generate combinations.
import std.stdio; int[3] t; void foo (int i) { if (i == 3) writef("%s\n", t); else foreach (x; 0 .. 3) { t[i] = x; foo(i+1); } } void main() { foo(0); }In C, I could put in the equivalent for statement for foreach, t[i] as the iterating variable. I won't need x which exists as a middleman only and save myself two lines.