Pure not acting pure.

Lars T. Kyllingstad public at kyllingen.NOSPAMnet
Thu Jun 16 11:01:57 PDT 2011


On Thu, 16 Jun 2011 17:38:27 +0000, Charles McAnany wrote:

> Ok, I think I get it. That cleared it up. =). So, if you have a
> functioned labelled pure, it's your job to not pass it mutable
> arguments, but the compiler's job to make sure it doesn't mutate
> anything not in the arguments. And that's why a strongly pure function
> can call a weakly pure one - only the first function's internal state
> can be mutated by a weakly pure function. Thanks!

Exactly. :)

-Lars


More information about the Digitalmars-d-learn mailing list