# Idea: mutatingForEach for Collections

**URL:** <https://forums.swift.org/t/idea-mutatingforeach-for-collections/18442>\
**Category:** Discussion\
**Created:** [November 30, 2018, 3:36pm UTC](https://forums.swift.org/t/idea-mutatingforeach-for-collections/18442 "2018-11-30T15:36:45Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

**Author:** ![mpangburn](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/mpangburn/32/45144_2.png) [@mpangburn](https://forums.swift.org/u/mpangburn)\
**Post date:** [November 30, 2018, 5:13pm UTC](https://forums.swift.org/t/idea-mutatingforeach-for-collections/18442/7 "2018-11-30T17:13:02Z")

</div>

This discussion has come up before. See [In-place map for MutableCollection](https://forums.swift.org/t/in-place-map-for-mutablecollection/11111).  
I'm in favor of the idea and don't have a strong opinion on its name.

Supporting this functionality at the language level has also come up:

```swift
for inout element in sequence {
    // ...
}

```

Both can exist (as `for-in` and `forEach` do), and I don't mean to imply that `for-inout`'s implementation should preclude the inclusion of the proposed method—but it's relevant to discussion here.

---

_[View the full topic](https://forums.swift.org/t/idea-mutatingforeach-for-collections/18442)._
