Boost logo

Boost :

From: Thorsten Ottosen (nesotto_at_[hidden])
Date: 2004-01-05 16:39:56


"Dan W." <danw_at_[hidden]> wrote in message
news:btce8o$658$1_at_sea.gmane.org...
> Thornsten, I agree with you 99.325%.

> Now, as I mentioned to you earlier, 4 years ago there was a heated
> polemic in an Eiffel forum about this exact same subject: What IS an
> object? What does ownership mean? Should constness propagate?
>
>
> And this I find interesting:
>
> In Eiffel, the lack of constness propagation INDEED violates command -
> query separation!

I might add that, as usual, one may ignore the existence of this principle,
but
one cannot escape its consequences.

> Unlike a C++ const member function, a query function,
> in Eiffel, is *expected* to have no side-effects, yet it CAN have
> side-effects through chained references. In this sense, C++ is the
> language that has the more self-consistent definition; and Eiffel the
> language that's broken. And remember that Eiffel has "deep_copy()".

If we were to try to compare the two different notion const-correctness,
that is,
(as written in the faq):

"Some programmers feel this should be a signal to the compiler that the raw
bits
of the object's `struct' aren't going to change, others feel it means the
*abstract* (client-visible) state of the object isn't going to change."

on one hand the notion of shallow raw bits objects and the abstract
observable state/behavior of the
class, then it should be clear that the latter is a much more powerful
concept. If followed, it really
makes it easier to show certain things holds in the program. Consider also
that the "observeable behavior"
is the idea used in formal operational semantics.

br

Thorsten


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk