GithubHelp home page GithubHelp logo

Comments (3)

bzbarsky avatar bzbarsky commented on May 21, 2024

The point here is that if two types are distinguishable, then given any object you have to be able to tell which of the two types it is.

This means that if there is an object which can claim to be of both types, they need to not be distinguishable. Therefore interpretation A is the correct one and we should adjust phrasing as needed to make that clear.

To determine if A and B are distinguishable, you have to look at all interfaces in the web platform

Yes, you do. That's necessary to achieve the "given any object" goal. I agree that this is rather annoying, but I don't see how the goal can be achieved otherwise.

And, is this actually implementable, or implemented by existing binding layers?

What Gecko's binding layer implements is the following:

Each interface has a set of interfaces associated with it. This set contains the interface itself, all interfaces inheriting from it (transitively, not directly), and all interfaces that have it as a "consequential interface" or inherit from an interface that has it as a consequential interface. So in your example above, the set associated with Baz just contains Baz itself. The set associated with Foo contains Foo and Baz. The set associated with Bar contains Bar and Baz. Two interfaces are distinguishable if their associated sets are disjoint (have no common members). I believe this is a correct implementation of your interpretation A.

from webidl.

jyasskin avatar jyasskin commented on May 21, 2024

Would it make sense to replace "It is not possible for a single platform object to implement both interfaces" with "No platform object implements both interfaces"? The non-local nature of the check is annoying, but at least this makes it clear.

from webidl.

bzbarsky avatar bzbarsky commented on May 21, 2024

I think once we have proper mixins this might be a lot easier to spec, especially if we don't allow mixins to be used as types. Because at that point, the only way for two interfaces to not be distinguishable will be if one of them inherits from the other, I believe.

from webidl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.