W3C home > Mailing lists > Public > public-script-coord@w3.org > July to September 2013

Re: Maybe we should think about Interface.isInterface functions again

From: Jonas Sicking <jonas@sicking.cc>
Date: Wed, 31 Jul 2013 11:02:14 -0700
Message-ID: <CA+c2ei92o7wbrfkjSh-w_8+B9HtKnq8SPLbS-uH1ykDKPxt1UQ@mail.gmail.com>
To: "Tab Atkins Jr." <jackalmage@gmail.com>
Cc: Allen Wirfs-Brock <allen@wirfs-brock.com>, Boris Zbarsky <bzbarsky@mit.edu>, Domenic Denicola <domenic@domenicdenicola.com>, Travis Leithead <travis.leithead@microsoft.com>, "public-script-coord@w3.org" <public-script-coord@w3.org>
On Wed, Jul 31, 2013 at 9:14 AM, Tab Atkins Jr. <jackalmage@gmail.com> wrote:
> On Wed, Jul 31, 2013 at 12:02 AM, Jonas Sicking <jonas@sicking.cc> wrote:
>> It's not entirely clear to me how you mean that the isDirectory
>> function would behave, or where it would live. Do you mean that we
>> would add a isDirectory() function on all Directory instances which
>> always return true?
>> That would mean that you write code like:
>> root.get("somename").then(function(result) {
>>   if ("isDirectory" in result) {
>>     // No need to actually call .isDirectory since it always returns true.
>>     ... it's a directory ...
>>   }
>>   else {
>>     ... it's a file ...
>>   }
>> });
> That's a branding approach, but no, that's not what's intended.
> Instead, the isFoo() method lives on the Foo interface object, not Foo
> instances.

I guess I misunderstood Allen. I thought that he felt that
Interface.isInterface functions "has a smell to it".

He also wrote "instance side isDirectory method" which made me think
it was something different from Interface.isInterface.

But so far I'm certainly in favor of adding more Interface.isInterface
functions, so if that's generally what people like then all the

/ Jonas
Received on Wednesday, 31 July 2013 18:03:15 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 17:14:17 UTC