Slice traits weren't: though, does `tree.mut_slice_between("foo", "bar")`
even make sense?On Fri, Nov 15, 2013 at 3:44 PM, Huon Wilson <[email protected]> wrote: > On 16/11/13 00:39, Oren Ben-Kiki wrote: > > If the traits were polymorphic in the index type (instead of always > expecting an integer), then one could use them to make hash tables use > vector syntax (e.g., `hash["foo"] = 1`)... Ruby does that, for example. So > something like bitset (with integer indices) isn't the only example. > > Not sure whether we want to go that way, though... > > Note that the traits in the blog posts are parameterised by the index > type: > > trait Index<I, E> { fn index<'a>(&'a self, index: I) -> &'a E; } > > Etc. >
_______________________________________________ Rust-dev mailing list [email protected] https://mail.mozilla.org/listinfo/rust-dev
