Re: myrange.at(i) for myrange.dropExactly(i).front

2014-07-29 Thread Timothee Cour via Digitalmars-d-learn
On Sun, Jul 27, 2014 at 9:20 PM, H. S. Teoh via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: On Sun, Jul 27, 2014 at 07:42:17PM -0700, Timothee Cour via Digitalmars-d-learn wrote: Just for clarification, I wanted 'myrange.at(i)' to be the same as

Re: myrange.at(i) for myrange.dropExactly(i).front

2014-07-27 Thread Timothee Cour via Digitalmars-d-learn
Just for clarification, I wanted 'myrange.at(i)' to be the same as `myrange.dropExactly(i).front` (so I don't assume it's a random access range). myrange.dropExactly(i).front makes it much more obvious what you're doing and that it's inefficient. It might be necessary in some cases, but we don't

Re: myrange.at(i) for myrange.dropExactly(i).front

2014-07-27 Thread H. S. Teoh via Digitalmars-d-learn
On Sun, Jul 27, 2014 at 07:42:17PM -0700, Timothee Cour via Digitalmars-d-learn wrote: Just for clarification, I wanted 'myrange.at(i)' to be the same as `myrange.dropExactly(i).front` (so I don't assume it's a random access range). myrange.dropExactly(i).front makes it much more obvious

Re: myrange.at(i) for myrange.dropExactly(i).front

2014-07-26 Thread monarch_dodra via Digitalmars-d-learn
On Saturday, 26 July 2014 at 00:28:32 UTC, Ary Borenszweig wrote: No, the OP said the meaning was `myrange.dropExactly(i).front`, which is not a random access. Sometimes you *do* want the n-th element of a range even if the range is not a random access. What he did also say is he wanted the

myrange.at(i) for myrange.dropExactly(i).front

2014-07-25 Thread Timothee Cour via Digitalmars-d-learn
Is there a function for doing this? myrange.at(i) (with meaning of myrange.dropExactly(i).front) it's a common enough operation (analog to myrange[i]; the naming is from C++'s std::vectorT::at)

Re: myrange.at(i) for myrange.dropExactly(i).front

2014-07-25 Thread Jonathan M Davis via Digitalmars-d-learn
On Friday, 25 July 2014 at 21:33:23 UTC, Timothee Cour via Digitalmars-d-learn wrote: Is there a function for doing this? myrange.at(i) (with meaning of myrange.dropExactly(i).front) it's a common enough operation (analog to myrange[i]; the naming is from C++'s std::vectorT::at) That would

Re: myrange.at(i) for myrange.dropExactly(i).front

2014-07-25 Thread Ary Borenszweig via Digitalmars-d-learn
On 7/25/14, 6:39 PM, Jonathan M Davis wrote: On Friday, 25 July 2014 at 21:33:23 UTC, Timothee Cour via Digitalmars-d-learn wrote: Is there a function for doing this? myrange.at(i) (with meaning of myrange.dropExactly(i).front) it's a common enough operation (analog to myrange[i]; the naming is

Re: myrange.at(i) for myrange.dropExactly(i).front

2014-07-25 Thread Jonathan M Davis via Digitalmars-d-learn
On Saturday, 26 July 2014 at 00:28:32 UTC, Ary Borenszweig wrote: On 7/25/14, 6:39 PM, Jonathan M Davis wrote: On Friday, 25 July 2014 at 21:33:23 UTC, Timothee Cour via Digitalmars-d-learn wrote: Is there a function for doing this? myrange.at(i) (with meaning of myrange.dropExactly(i).front)