On 8/23/13 8:04 AM, Oren Ben-Kiki wrote:
Yes, this would be similar to the `Typeable` type class in Haskell. It queries the vtable-equivalent, which contains stuff like the name of the type and allows doing `typeof(x)`, dynamic casts, etc. This is heavily magical (that is, depends on the hidden internal representation) and properly belongs in the standard platform and not in a user-level library.
I had always figured we'd copy Haskell's `Data.Typeable` solution more or less exactly. I think we can do it in a library though, as Niko pointed out; in general we aren't afraid of adding deep compiler-specific magic into our libraries.
Patrick _______________________________________________ Rust-dev mailing list [email protected] https://mail.mozilla.org/listinfo/rust-dev
