You could always use __FUNCTION__ in a string mixin, but that _is_ rather ugly.
Like this ? auto fac = delegate(int n) { if (n <= 1) return 1; return n * mixin(__FUNCTION__)(n - 1); };
Well, there are a few problems with this: - it _is_ ugly- some 'automatic' name should be generated internally (possibly it is in any case)
- it doesn't currently work Possibly more streamlined approach would be: thisFunc (or 'self', or whatever) thisFunc.stringof istead of __FUNCTION__