Uh... destructors?

%u wfunction at hotmail.com
Wed Feb 23 11:28:01 PST 2011


> No. pure is what we want. Changing it would break code and contradict TDPL (though the
addition of weakly pure isn't in TDPL). Strongly pure functions are essentially what you'd
expect from pure. Weakly pure functions aren't, but they're necessary to make pure very
useful, and there's no real benefit in using a new keyword or attribute to mark them. pure is
the word used because we're modeling the idea that multiple calls to the same function with
the same parameters have the same result - which is indeed the case with strongly pure
functions. The funny case is weakly pure, but it's _not_ optimized out, and it's necessary for
pure to be useful. You can clearly see whether a function is weakly or strongly pure by
looking at its signature, so I really don't think that it's an issue.


You keep on mentioning that weakly pure "is necessary for pure to be useful", but the problem
is, even if something looks like a duck and walks like a duck, that doesn't mean it's a duck!
Just because __declspec(noalias) _appears_ to mean the same thing as pure from the outside
perspective that doesn't bother to peek too much into things doesn't mean that it's the same
thing (it obviously isn't).
You're mentioning yourself that "weakly pure" isn't in the language specs... and if DMD is
supposed to be a D compiler, shouldn't it actually follow the exact spec? (If "weakly pure"
was actually intentional, then shouldn't it actually _be_ in the spec? Otherwise, the compiler
is clearly contradicting TDPL about a fundamental CS concept, isn't it?)


More information about the Digitalmars-d mailing list