Skip to content

D186 (§13.3): zip, chain and zip_with take any iterable (#2962) - #3002

Merged
ehartford merged 1 commit into
mainfrom
d186-iterable-zip
Nov 3, 2026
Merged

ehartford merged 1 commit into
mainfrom
d186-iterable-zip

Conversation

@ehartford

Copy link
Copy Markdown
Contributor

Closes #2962.

An argument of a zip, chain or zip_with stage that is iterable but no Iter (a List, an array, a range) iterates by the rule for uses: Sema records the .iter() under the argument node (implicit_iter_args, the for_iter_* records), MIR calls it where the argument is read. The iterable is observed, never consumed.

Fixture behav_d186_iterable_zip; the conformance row flips to implemented. Found on the way: #3001 (ranges are absent from the §9.9 precedence table, so 0..3 |> map(f) parses the pipe inside the range).

Gate green (489 s); the battery runs once on the stack top.

An argument of a zip, chain or zip_with stage that is iterable but no
Iter (a List, an array, a range) iterates by the rule for uses: Sema
records the .iter() under the argument node (implicit_iter_args, the
for_iter_* records), MIR calls it where the argument is read. The
iterable is observed, never consumed. Fixture behav_d186_iterable_zip;
the conformance row flips to implemented.
@ehartford
ehartford added this pull request to stack #3008 November 3, 2026 06:52
@ehartford
ehartford marked this pull request as ready for review November 3, 2026 08:21
@ehartford
ehartford merged commit b17b112 into main Nov 3, 2026
@ehartford
ehartford deleted the d186-iterable-zip branch November 3, 2026 08:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

§13.3 zip(Iter[U]), chain(Iter[T]), zip_with(Iter[U], …) force ys.iter() at the call; for takes any iterable, these should too

1 participant