<feed xmlns='http://www.w3.org/2005/Atom'>
<title>rust/src/libstd/iterator.rs, branch beta</title>
<subtitle>https://github.com/rust-lang/rust
</subtitle>
<id>http://git.dreamy.place/mirrors/rust/atom?h=beta</id>
<link rel='self' href='http://git.dreamy.place/mirrors/rust/atom?h=beta'/>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/'/>
<updated>2013-09-09T07:21:46+00:00</updated>
<entry>
<title>rename `std::iterator` to `std::iter`</title>
<updated>2013-09-09T07:21:46+00:00</updated>
<author>
<name>Daniel Micay</name>
<email>danielmicay@gmail.com</email>
</author>
<published>2013-09-08T15:01:16+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=6919cf5fe14701621437fcb57f3a0c38fb394c65'/>
<id>urn:sha1:6919cf5fe14701621437fcb57f3a0c38fb394c65</id>
<content type='text'>
The trait will keep the `Iterator` naming, but a more concise module
name makes using the free functions less verbose. The module will define
iterables in addition to iterators, as it deals with iteration in
general.
</content>
</entry>
<entry>
<title>std: Rename Unfoldr to Unfold.</title>
<updated>2013-09-08T00:52:19+00:00</updated>
<author>
<name>Huon Wilson</name>
<email>dbau.pp+github@gmail.com</email>
</author>
<published>2013-09-08T00:52:19+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=4c2b480aae2abb87e617076ee3f672f5c851d7d0'/>
<id>urn:sha1:4c2b480aae2abb87e617076ee3f672f5c851d7d0</id>
<content type='text'>
The `r` is not relevant, since there is only one direction of folding
(unlike Haskell).
</content>
</entry>
<entry>
<title>auto merge of #8884 : blake2-ppc/rust/exact-size-hint, r=huonw</title>
<updated>2013-09-03T13:56:05+00:00</updated>
<author>
<name>bors</name>
<email>bors@rust-lang.org</email>
</author>
<published>2013-09-03T13:56:05+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=1ac8e8885bb1917f71ce432dcf181253b47f0bca'/>
<id>urn:sha1:1ac8e8885bb1917f71ce432dcf181253b47f0bca</id>
<content type='text'>
The message of the first commit explains (edited for changed trait name):

The trait `ExactSize` is introduced to solve a few small niggles:

* We can't reverse (`.invert()`) an enumeration iterator
* for a vector, we have `v.iter().position(f)` but `v.rposition(f)`.
* We can't reverse `Zip` even if both iterators are from vectors

`ExactSize` is an empty trait that is intended to indicate that an
iterator, for example `VecIterator`, knows its exact finite size and
reports it correctly using `.size_hint()`. Only adaptors that preserve
this at all times, can expose this trait further. (Where here we say
finite for fitting in uint).

---

It may seem complicated just to solve these small "niggles",
(It's really the reversible enumerate case that's the most interesting)
but only a few core iterators need to implement this trait.

While we gain more capabilities generically for some iterators,
it becomes a tad more complicated to figure out if a type has
the right trait impls for it.
</content>
</entry>
<entry>
<title>std::iterator: Use ExactSize, inheriting DoubleEndedIterator</title>
<updated>2013-09-01T16:17:26+00:00</updated>
<author>
<name>blake2-ppc</name>
<email>blake2-ppc</email>
</author>
<published>2013-09-01T14:46:12+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=35040dfccc6674e8eda71b34a8cd1b4cc1b45842'/>
<id>urn:sha1:35040dfccc6674e8eda71b34a8cd1b4cc1b45842</id>
<content type='text'>
Address discussion with acrichto; inherit DoubleEndedIterator so that
`.rposition()` can be a default method, and that the nische of the trait
is clear. Use assertions when using `.size_hint()` in reverse enumerate
and `.rposition()`
</content>
</entry>
<entry>
<title>std::iterator: Add back .rposition() test</title>
<updated>2013-09-01T16:17:19+00:00</updated>
<author>
<name>blake2-ppc</name>
<email>blake2-ppc</email>
</author>
<published>2013-09-01T14:43:47+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=04845f0aebd6928bb924147fd93de8dac13ff850'/>
<id>urn:sha1:04845f0aebd6928bb924147fd93de8dac13ff850</id>
<content type='text'>
</content>
</entry>
<entry>
<title>std: Implement .rposition() on double-ended iterators with known size</title>
<updated>2013-08-30T18:06:26+00:00</updated>
<author>
<name>blake2-ppc</name>
<email>blake2-ppc</email>
</author>
<published>2013-08-30T18:00:14+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=db22f2627d625ba9481a16e44f1cc3195e8d6ef7'/>
<id>urn:sha1:db22f2627d625ba9481a16e44f1cc3195e8d6ef7</id>
<content type='text'>
This is a generalization of the vector .rposition() method, to all
double-ended iterators that have the ExactSizeHint trait.

This resolves the slight asymmetry around `position` and `rposition`

* position from front is `vec.iter().position()`
* position from the back was, `vec.rposition()` is now `vec.iter().rposition()`

Additionally, other indexed sequences (only `extra::ringbuf` I think),
will have the same method available once it implements ExactSizeHint.
</content>
</entry>
<entry>
<title>std::iterator: Add tests for .next_back() on Zip and Enumerate</title>
<updated>2013-08-30T18:06:26+00:00</updated>
<author>
<name>blake2-ppc</name>
<email>blake2-ppc</email>
</author>
<published>2013-08-30T18:00:11+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=e7955b2a7d880ecf2de30e5bc3a452bea0db4fd4'/>
<id>urn:sha1:e7955b2a7d880ecf2de30e5bc3a452bea0db4fd4</id>
<content type='text'>
</content>
</entry>
<entry>
<title>std::iterator: Implement .next_back() for Zip</title>
<updated>2013-08-30T18:06:26+00:00</updated>
<author>
<name>blake2-ppc</name>
<email>blake2-ppc</email>
</author>
<published>2013-08-30T18:00:07+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=ed607dd24aa1e041e4077b356e6bfa88c56b7fcf'/>
<id>urn:sha1:ed607dd24aa1e041e4077b356e6bfa88c56b7fcf</id>
<content type='text'>
Let Zip be double-ended when both its children have the ExactSizeHint
trait.
</content>
</entry>
<entry>
<title>std::iterator: Introduce trait ExactSizeHint</title>
<updated>2013-08-30T18:03:40+00:00</updated>
<author>
<name>blake2-ppc</name>
<email>blake2-ppc</email>
</author>
<published>2013-08-30T17:59:49+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=4b2cc22031d56a4846bc0ad4e65e19892db734c4'/>
<id>urn:sha1:4b2cc22031d56a4846bc0ad4e65e19892db734c4</id>
<content type='text'>
The trait `ExactSizeHint` is introduced to solve a few small niggles:

* We can't reverse (`.invert()`) an enumeration iterator
* for a vector, we have `v.iter().position(f)` but `v.rposition(f)`.
* We can't reverse `Zip` even if both iterators are from vectors

`ExactSizeHint` is an empty trait that is intended to indicate that an
iterator, for example `VecIterator`, knows its exact finite size and
reports it correctly using `.size_hint()`. Only adaptors that preserve
this at all times, can expose this trait further. (Where here we say
finite for fitting in uint).
</content>
</entry>
<entry>
<title>Make Zip iterator short-circuit</title>
<updated>2013-08-30T05:49:26+00:00</updated>
<author>
<name>Kevin Ballard</name>
<email>kevin@sb.org</email>
</author>
<published>2013-08-03T22:41:29+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=a3d18bc95b1639cf3cb967165f7104e2c79893f5'/>
<id>urn:sha1:a3d18bc95b1639cf3cb967165f7104e2c79893f5</id>
<content type='text'>
Python's zip() short-circuits by not even querying its right-hand
iterator if the left-hand one is done. Match that behavior here by not
calling .next() on the right iterator if the left one returns None.
</content>
</entry>
</feed>
