On 10/22/12 1:59 PM, Nathan wrote:
Is the indexing operation a primitive language implementation, or does
it translate into a trait method or some other user-definable
behavior?  In the latter case, what is it's interface?  (Nothing in
the vec docs for 0.4 obviously implement v[i].)

It desugars to an invocation of a method on the Index trait in core::ops, which is parameterized over the right-hand side. However, indexing into a primitive vector type is currently a primitive operation defined over both ints and uints.

If it doesn't prove would be terribly inconvenient, I would be in favor of changing this to desugar to a trait implementation in the core vec module defined over uints only.

Patrick

_______________________________________________
Rust-dev mailing list
Rust-dev@mozilla.org
https://mail.mozilla.org/listinfo/rust-dev

Reply via email to