Nick Sabalausky:

I submit that nested functions should be exempt from the usual sequential visibility rules. (Therefore, mutually recursive nested functions would
become possible.)

What about static nested functions? This seems a simpler
enhancement request:

import std.stdio;
void main() {
   static int male(in int n) pure nothrow {
     return n ? (n - female(male(n - 1))) : 0;
   }
   static int female(in int n) pure nothrow {
     return n ? (n - male(female(n - 1))) : 1;
   }
   writeln(female(15));
}

Bye,
bearophile

Reply via email to