Idea: mutatingForEach for Collections

I'd like to push back on this a little bit. If we have a for &x in a kind of feature we're pretty confident is coming, we shouldn't pre-empt it in an ABI-stable library temporarily until we have it. The helper is easy for people to add themselves if they really feel it would simplify their code in the meantime.

I admit a bias here: I think Sequence.forEach is horrendous and if I had my way, would expunge it from the language (luckily for its fans, I won't have my way for source compat reasons if no other, and it's here to stay). So modeling a mutating version on it would be something I'd really rather not do except as the only and ultimate solution, rather than a stop-gap.

5 Likes