Tsoding - How Not to Market Your Language Features

Walter Bright newshound2 at digitalmars.com
Wed Apr 2 17:34:11 UTC 2025


On 4/2/2025 8:16 AM, Timon Gehr wrote:
> Can you show the code that you mean or give a more accurate time stamp? I only 
> see the _delegate's_ parameter `i` at 1:19:41, which does not lead to shadowing, 
> as the only actual parameter in scope within `opApply` is `dg`.

The foreach of an opapply is rewritten by dmd into a delegate. If the shadowing 
is not detected, this would be why.

I actually regret this design. It's overly complex, and I always have to look up 
how to write an opApply function.

It could be done with ranges, if the ranges internally implemented some sort of 
stack.


More information about the Digitalmars-d mailing list