Indeed you can. But do you think of a useful, common use case? Starting to
count from 0 is indeed very useful, but you can use enumerate() for this.

It seems to me that in the rare cases where it's useful, a special version
like "zipcut" should be used, so that the usual use case will be checked
for errors.

Noam

On 5 May 2013 23:51, Daniel Micay <[email protected]> wrote:

> On Sun, May 5, 2013 at 4:49 PM, Masklinn <[email protected]> wrote:
> >
> > Now here's the question, to which I don't have an answer but which will
> > tell you whether your suggestion makes sense — at least when compared
> > to existing languages: is it possible to have an infinite vector in Rust,
> > or to zip finite and infinite datastructures (iterators?) together?
>
> Yes, you can make infinite generators implementing the Iterator trait.
> One example of that is `iterator::Counter::new(1, 2)` which is the
> same as `[1,3..]` in Haskell.
> _______________________________________________
> Rust-dev mailing list
> [email protected]
> https://mail.mozilla.org/listinfo/rust-dev
>
_______________________________________________
Rust-dev mailing list
[email protected]
https://mail.mozilla.org/listinfo/rust-dev

Reply via email to