Why is std.algorithm.reduce impure?

Simen Kjærås simen.kjaras at gmail.com
Wed Mar 7 08:29:24 PST 2012


On Wed, 07 Mar 2012 01:41:22 +0100, Jonathan M Davis <jmdavisProg at gmx.com>  
wrote:

> It really takes very little for something to be impure, and optimizations
> often do it, because they end up using low-level constructs which aren't  
> pure
> - some of which could be but aren't and others which probably can't be.

Just so this is clear - no optimization of the compiler is going to change
the purity of a function. An optimization on the part of the programmer
(like using appender) might, though.


More information about the Digitalmars-d-learn mailing list