import std.stdio; void main() { // X will point to each one of these in turn void X1(int x) { writef("%s+2: %s\n",x,x+2); } void X2(int x) { writef("You gave me: %s\n",x); } void X3(int x) { writef("Square: %s\n",x*x); } // Now we run through the different Xs, and "run" inc.inc using each one as X foreach(X;[&X1,&X2,&X3]) mixin(import("inc.inc")); }