Fully transitive const is not necessary
Janice Caron
caron800 at googlemail.com
Wed Apr 2 07:10:03 PDT 2008
Bugger! That last post got sent before I'd finished writing it.
> c.some.deeply.nested.but.reachable.var++; // OK (compiled with D2)
Overriding "opPostInc() const" doesn't prove anything. If you want to
make a serious point, just call you function f or foo or something.
Using operator overloads to disguise what's going on doesn't make
/anything/ clearer.
> The point is that logical const is still possible, even with transitive
> const, because the global namespace is not const.
It seems you and I disagree about the meaning of the phrase "logical
const". The ability to manipulate global variables does not constitute
logical constancy in my book.
> HOWEVER, the point that everyone is arguing is why does logical const make
> pure functions or functional programming impossible? Clearly, it is ALREADY
> POSSIBLE to have logical const
We are suffering from a communications difficulty caused by you and I
using the same phrase ("logical const") to mean entirely different
things. Unless we can agree on a common terminology, we're not going
to be able to get anywhere with this discussion.
More information about the Digitalmars-d
mailing list