Yup, and you almost guessed the syntax. In the function literal, "function" goes before the return type:
void function() test = function void () {...};
Much of that is optional. This does the same (as long as the compiler can infer everything):
auto test = {...};
Further reading: http://dlang.org/expression.html#FunctionLiteral, http://dlang.org/function.html#closures
Also, you can just nest functions in D:
void main()
{
void test() {...}
test();
}