On Tue, Jul 8, 2014 at 2:24 PM, Matt Oliveri <[email protected]> wrote:

>
>
Let me clarify by restating what I think you mean.
> - Interfaces would use record subtyping for the set of methods provided.
>

Yes. Or something very close. The presence of the existential means that it
isn't quite record subtyping.


> - There is no notion of "virtual" because there's no class hierarchy.
>

Not quite. There is no notion of virtual because methods can't be
overridden in the way that C++/Java/C# do so.


> - However, interface methods are dynamically dispatched to whatever
> implementation is provided by an element of the type. (Via a vTable
> pointer.)
>

I'm not sure what you mean by "dynamically dispatched". The vTable is a
detail of implementation. The important question is: what is the difference
between this and invoking a field that has procedure type. The answer is
that the call is hijacked and rewritten such that the receiver gets the
existential datum.


> - Functions that should not dynamically dispatch should not be
> interface methods.


I'm not sure why we care that functions are dynamically dispatched. If you
*do* care, you also shouldn't use closures and a bunch of other things.

But also: I don't think of this as dynamic dispatch. Dynamic dispatch
involves some form of computed method lookup whose result is
context-dependent in some way. That isn't going on here.


shap
_______________________________________________
bitc-dev mailing list
[email protected]
http://www.coyotos.org/mailman/listinfo/bitc-dev

Reply via email to