On 7/11/12 2:03 PM, Timon Gehr wrote:
I think they should be pure as much as I think they should be const.

The reasoning is analogous for both.

We have immutable class instances that want to provide the methods =>
make them const.

We have pure functions that want to provide the methods => make them pure.

This reasoning is not taking into account the whole picture because

We have implementations of those methods that want to use non-const
methods in their implementation. (eg. database connection)

We have implementation of those methods that want to use non-pure
methods in their implementation (eg. database connection, logging)

The essential difference is there's no "pure" object, so there's no motivation to plant "pure" on its methods.

Andrei

Reply via email to