Agree, though the function should probably be named something like: withEach instead of forEach. Maybe worth a proposal on evolution?
Regards, Rien Site: http://balancingrock.nl Blog: http://swiftrien.blogspot.com Github: http://github.com/Balancingrock Project: http://swiftfire.nl - A server for websites build in Swift > On 26 Apr 2017, at 16:47, J.E. Schotsman via swift-users > <[email protected]> wrote: > > > On 26 Apr 2017, at 16:27, Rien <[email protected]> wrote: > >> To edit the value in the array itself use: >> >> array[index].number += 1 > > That requires a for loop. > Functional programming lets you write for loops more succinctly. > Why can’t $0 not be used as a reference, like array[index] ? > I've checked, it’s not among the commonly rejected proposals. > > Jan E. > > _______________________________________________ > swift-users mailing list > [email protected] > https://lists.swift.org/mailman/listinfo/swift-users _______________________________________________ swift-users mailing list [email protected] https://lists.swift.org/mailman/listinfo/swift-users
