On 15/01/10 08:25, bearophile wrote:
int foo3(int x, private int depth=0) {
   ...
   foo3(x+1); // OK
   foo3(x, depth + 1); // OK
   ...
}
void main() {
   int r = foo3(5); // OK
   int r = foo3(5, 1); // Error
   int r = foo3(5, 0); // Error
}

Does this not achieve the same effect? (OK, the syntax is a bit more verbose, but it'd do the trick?)

----
int foo3(int x)
{
   static int depth = 0;
   foo3( x + 1 );
   depth++;
   foo3( x );
}
----

Reply via email to