Lookhead for nested functions

Walter Bright newshound2 at digitalmars.com
Sat Jun 15 06:03:11 UTC 2019


On 6/14/2019 5:50 AM, Timon Gehr wrote:
> If you need mutual recursion for local functions, this hack works:
> 
> void foo(){
>      void bar()(){ baz(); }
>      void baz(){ bar(); }
> }

Using function pointers also works.

The point being, the use cases are rare enough that such workarounds are 
reasonable given the problems of trying to compile forward dependencies.


More information about the Digitalmars-d mailing list