Consider supporting iterator combinators where the combinator chain is discharged with a for-loop and with a .collect::<Vec<_>>()
#753
Replies: 2 comments 1 reply
-
|
Just noting that the specific feature that I was mentioning earlier today as quite rare was the splitting of an iterator into two to consume parts of the iterator separately, basically using Using I think it is perfectly fine for a first pass to ignore these manual |
Beta Was this translation helpful? Give feedback.
-
|
Hi! I'm looking into adding these specs (at least to a couple of combinators to begin with). I have two main questions. First, how to structure the specs:
The second question relates to how one would go about relating the iterator view between the original and the adapted one. Continuing the example of fn enumerate(self) -> (r: Enumerate<Self>)
ensures forall|i: int| 0 <= i ==> i == r@[i].0 && self@[i] == r@[i].1 Where we relate the values between the original and the adapted and the position with the first element of the pair. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
and without explicit calls to
.next(), which are rare in practice (as noted by @jaybosamiya).We can start by supporting iterating on
Range, and then combinations of.map,.filteretc that directly map to aSeqspec transformation when the iterator combinator chain is.collected in one shot (@Chris-Hawblitzel, @utaal).Beta Was this translation helpful? Give feedback.
All reactions