I&#39;m fair sure that logical const is a real world requirement.<br><br>Take the classic example Shape, for example...<br><br>const Rectangle r = new Shape();<br>r.draw();<br><br>Whoops! Const-transitivity prevents r.draw
() from compiling. Why? Because Shape has a member variable Raster, and Rectangle.draw() calls Raster.paintRectangle() or some such, which modifies the state of the raster.<br><br>So what do you do? You could try changing the prototype to
<br>class Rectangle { override invariant draw(Raster raster); }<br><br>But now it still won&#39;t compile, because the abstract function Shape.draw wasn&#39;t declared like that, so then you have to go back another step and change /that/ declaration to:
<br>class Shape { abstract invariant draw(Raster raster); }<br><br>It&#39;s a solution which doesn&#39;t scale.<br><br>And there goes encapsulation...<br><br>