Implementing Pure Functions

Kagamin spam at here.lot
Fri Jun 17 03:54:50 PDT 2011


Andrei Alexandrescu Wrote:

> Right. I gave that example within the context of the discussion, which 
> considered purity a path-sensitive property. By that definition, if fun 
> is provably never invoked with a > 10, then it's effectively pure.

That's kinda holistic approach, quite strange thing to see in modern programming. The term "pure function" implies decomposition and definition of purity for parts the program was decomposed to. Usually it's a functional decomposition and in D purity is function-level. I would say that holistic approach is inadequate for notion which is reductionist by its nature.


More information about the Digitalmars-d mailing list