On Fri, Aug 25, 2006 at 08:40:59AM -0400, Mark J. Reed wrote: : On 8/25/06, Juerd <[EMAIL PROTECTED]> wrote: : >You define in terms of functionality, but don't provide an explanation : >for the chosen point of view. One could say that constant arrays protect : >against : >modifications, which normal arrays don't. Hence, constant arrays do *more*. : : I think the justification for Luke's POV is the number of operations : each class provides. But my perspective agrees with Juerd - : subclasses can remove functionality as well as adding it, and I : definitely view "constant" as an add-on modifier, not a default that : has to be overridden.
And in my view, types that remove functionality aren't called "subclasses" but rather "subsets", and actually have the same underlying actual class, but with different constraints. Another view of the Array problem is that $x ~~ Array is testing against the Array role rather than the Array class, and that the Array class is just the default implementation of the Array role. Array::Const is just a different implementation, like a tie. So there are at least two ways in Perl 6 to sneak around strict Liskovism. Larry