Re: JSIDL ideas for read only (Was: RE: Figuring out easier readonly interfaces)

On Thu, Oct 3, 2013 at 5:18 AM, Domenic Denicola
<domenic@domenicdenicola.com> wrote:
> From: Tab Atkins Jr. [mailto:jackalmage@gmail.com]
>> This is precisely the "two interfaces" problem, though.  If I want to extend Point in the future, I need to remember to put a getter on Point and a setter on MutablePoint.  That's a maintenance hazard I was trying to avoid.
>
> I don't see a way to avoid this, though. There may be some properties you want to make mutable in the subclass, but not all of them (e.g. not `length`). You'll need to explicitly enumerate what aspects of the class become mutable in the subclass, and doing so with getter declarations seems nice.

Right, but we can already write something like this in WebIDL, so this
isn't gaining us anything.  And I'm explicitly trying to find a
solution that results in a single interface, with some way for the
implementation to detect that it's readonly.

But I can't think of any way to do it that actually works. :/

~TJ

Received on Thursday, 3 October 2013 17:17:46 UTC