A comptime variable in D would look like:
enum v = foo(3);
Since an enum initialization is a ConstExpression, it's initialization must be evaluated at compile time.A comptime function parameter in D looks like:
int mars(int x)(int y) { ... }
where the first parameter list consists of compile time parameters, and the second the runtime parameters.D does not have a switch-over-types statement, but the equivalent can be done with a sequence of static-if statements:
static if (is(T == int)) { ... }
else static if (is(T == float)) { ... }
Static If is always evaluated at compile time. The IsExpression does pattern matching on types.