On 11/11/2011 07:29 AM, Niko Matsakis wrote:
In principle, it might be nice to allow something like bounded polymorphism:

     fn call_foo<T:has_foo>(x: T) {
         x.foo();
     }

Without subtyping, it would make less sense. Perhaps it corresponds
to
passing the vtable that converts a `T` into a `has_foo`, so when you
invoke x.foo() it compiles down to "T_vtable.foo(x)" (which I think is
how Haskell type classes work at runtime, but that's more from me
guessing, perhaps people who know Haskell better can correct me).

It does.

Patrick
_______________________________________________
Rust-dev mailing list
[email protected]
https://mail.mozilla.org/listinfo/rust-dev

Reply via email to