Re: [rust-dev] RFC: Iterator naming convention

2013-12-21 Thread Ziad Hatahet
I favor this approach too. As an example, Scala does something similar: a call to Map() constructs an immutable map object (it is in the default namespace), whereas if you want a mutable Map object, you have to import it from scala.collection.mutable.Map. -- Ziad On Fri, Dec 20, 2013 at 10:50

Re: [rust-dev] RFC: Iterator naming convention

2013-12-21 Thread Liigo Zhuang
I like Iter suffix, short, and say what it is. 在 2013年12月21日 下午12:51,Palmer Cox palmer...@gmail.com写道: I noticed recently that there seem to be 3 distinct Iterator naming conventions currently in use: 1. Use the Iterator suffix. Examples of this are SplitIterator and DoubleEndedIterator. 2.

Re: [rust-dev] RFC: Iterator naming convention

2013-12-21 Thread Palmer Cox
I'm not a big fan of Hungarian notation either. I'm not sure that having a naming convention for Iterators is Hungarian notation, however. For example, if you are doing Windows programming, you'll see stuff like: DWORD dwFoo = 0; In this case, the dw prefix on the variable indicates that we have

Re: [rust-dev] RFC: Iterator naming convention

2013-12-21 Thread Kevin Cantu
Iterators are just structs which implement the Iterator or a related trait, right? These structs which do can also implement lots of other traits, too: no reason to make -Iter special. Kevin On Sat, Dec 21, 2013 at 12:50 PM, Palmer Cox palmer...@gmail.com wrote: I'm not a big fan of

Re: [rust-dev] RFC: Iterator naming convention

2013-12-21 Thread Palmer Cox
Are there examples of structs that implement Iterator that also implement other non-Iterator related traits? Although its possible to do that, I can't think of a use case for it off the top of my head. An Iterator basically represents the state of an ongoing computation and once that computation

Re: [rust-dev] RFC: Iterator naming convention

2013-12-21 Thread Kevin Cantu
Rust's standard libs are still pretty thin on their trait hierarchies, but I'm sure this will change. Kevin On Sat, Dec 21, 2013 at 1:30 PM, Palmer Cox palmer...@gmail.com wrote: Are there examples of structs that implement Iterator that also implement other non-Iterator related traits?

Re: [rust-dev] RFC: Iterator naming convention

2013-12-21 Thread Corey Richardson
The reason the Iterator suffix was removed is because when when one is required to write the type signature it becomes hugely annoying to keep writing Iterator all the time. Personally I think Alex's idea is a good way forward. On Sat, Dec 21, 2013 at 4:35 PM, Kevin Cantu m...@kevincantu.org

Re: [rust-dev] RFC: Iterator naming convention

2013-12-21 Thread Eric Reed
I prefer the 'no suffix' option and generally agree with Alex. Iterators aren't special and their iterator behavior is already denoted by implementing the Iterator trait. Frankly, aside from documentation where it is clear that something is an iterator, I'm not sure when a user would even see

Re: [rust-dev] RFC: Iterator naming convention

2013-12-20 Thread yati sagade
I personally like #1, the Iterator suffix for all iterators. It is very slightly verbose, but I think most of the time this should not matter. On Sat, Dec 21, 2013 at 10:21 AM, Palmer Cox palmer...@gmail.com wrote: I noticed recently that there seem to be 3 distinct Iterator naming