On Thu, Feb 21, 2013 at 3:17 PM, Niko Matsakis <n...@alum.mit.edu> wrote: > > > Ashish Myles wrote: >> 5. Consistency of len/size: >> Each language seems to have its own standard for specifying container >> size. I thought Rust's convention was len from vector, dvec, list, etc, >> but deque uses size. Should that also be len? Or rather, as "size" is >> the more generic term (applies semantically to arbitrary containers >> like >> trees and maps), should "size" be the standard? Or, like ruby, perhaps >> both could be allowed. > > Good question. This is the sort of thing that we are going to be addressing > as we cleanup the libraries. I agree we should settle on one. I don't > personally care which it is. I'm personally not bothered by the semantic > mismatch of a set having a length, but I guess `size()` would be the most > broadly applicable and least likely to inspire later flame wars.
FWIW Qt uses `count()`. (but also has size() for STL compatibility, and length() as well when it makes sense...) -- Your ship was destroyed in a monadic eruption. _______________________________________________ Rust-dev mailing list Rust-dev@mozilla.org https://mail.mozilla.org/listinfo/rust-dev