On Wednesday, 28 May 2014 at 18:08:42 UTC, Walter Bright wrote:
On 5/28/2014 1:49 AM, Russel Winder via Digitalmars-d wrote:
Also, D's approach does not support lazy evaluation, caches of
all sorts
etc, that we think are crucial in application software.
Yes, that's so-called "logical const". This has come up several
times here, and many have argued strongly to support it.
My view is that logical const is not mechanically checkable,
and therefore is a convention. D's const'ness is about
guarantees, not conventions.
Of course, D offers an escape from anything. You can do logical
constness by using unsafe casts, but the onus is then on you to
get it right.
It is probably a good idea to provide such escape in a safe
interface somewhere in the library, no ?