Re: Figuring out easier readonly interfaces

On Thu, Oct 17, 2013 at 2:10 AM, Simon Pieters <simonp@opera.com> wrote:

> On Thu, 17 Oct 2013 01:21:36 +0200, Mark S. Miller <erights@google.com>
> wrote:
>
>  Readonly doesn't mean immutable or constant.
>>>
>>>
>> No one said it did. That would be silly ;).
>>
>> Read only means that, through this object, changes to some underlying
>> state
>> can be observed but not caused. In order for changes to be observed, it
>> must be possible to cause those changes, but holding this object is not by
>> itself adequate to cause those changes.
>>
>
> OK, then I misunderstood the argument. Sorry.
>
> Is the problem here that a mutable DOMRect instance has DOMRectReadOnly in
> the prototype chain, which is a lie?


Essentially, yes. I'm not so much concerned with implementation inheritance
as with subtyping. Inheritance is an implementation matter of the providers
of the abstractions, so whatever works is fine. Subtyping is what clients
see. Choosing names for subtyping relationships which lie is bad. Choosing
names that seem to promise safety restrictions which they do not is
dangerous.



>
>
> --
> Simon Pieters
> Opera Software
>



-- 
    Cheers,
    --MarkM

Received on Thursday, 17 October 2013 14:08:24 UTC