Calling nested function before declaration

Timon Gehr timon.gehr at gmx.ch
Thu Sep 27 18:33:40 UTC 2018


On 27.09.2018 00:46, Jonathan wrote:
> 
> 
> I can't see how the current behavior is at all better or to be preferred 
> unless it is faster to compile?  What is the reason for it being how it is?

The current behavior is easy to specify and simple to implement, and it 
is what Walter has implemented. A better behavior that is almost as 
simple to implement would be to insert nested functions into the symbol 
table in blocks of back-to-back-defined nested functions, but that would 
be a breaking language change at this point. (Maybe you can get a DIP 
though though.) Otherwise, the template workaround is a bit ugly but it 
works and is non-intrusive.


More information about the Digitalmars-d mailing list