On 13/03/2011 12:00 PM, Marijn Haverbeke wrote:
Then, as in your example, when a function passes an int to a function
one of whose type parameters is restricted to type Number, that is the
point where the vtable for int/Number is looked up, and passed along.
As an optimization, you can make this vtable point to the int type, so
that you don't have to pass both the vtable and the type descriptor to
the polymorphic function.
Let me know if that doesn't make sense.
I'm having a hard time seeing an operational distinction between this
description and "wrapping an int in an obj conforming to the obj-type
called Number", aside from perhaps a nomenclature one ("wrapping
objects" vs. "instantiating typeclasses"). Sorta reminds me of Xavier's
pithy old slide about OO/FP discourse differences:
http://venge.net/graydon/elitist.png :)
But at any rate .. I ask once more that we shelve this whole topic until
after we have more substantial pieces of the language re-implemented in
rustc. We don't support more than, say, 60% of the manual's claims right
now. It's a bit embarrassing.
-Graydon
_______________________________________________
Rust-dev mailing list
[email protected]
https://mail.mozilla.org/listinfo/rust-dev