The disadvantage of purity

Dominikus Dittes Scherkl dominikus at
Sun Dec 29 10:46:07 UTC 2019

On Sunday, 29 December 2019 at 10:02:48 UTC, berni44 wrote:

> The problem is, that this function should indeed return 
> something different, when it calls itself (indirectly) with 
> identical parameters once more to prevent the original call 
> from never returning...

This should indeed be NOT the same parameters. There should be a 
hidden additional parameter (lets name it "called_internal"), 
that be false in the original call and true in a recursion. With 
this it's perfectly pure while returning something different if 
called by itself.

More information about the Digitalmars-d mailing list