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 > <swift-users@swift.org> wrote: > > > On 26 Apr 2017, at 16:27, Rien <r...@balancingrock.nl> 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 > swift-users@swift.org > https://lists.swift.org/mailman/listinfo/swift-users _______________________________________________ swift-users mailing list swift-users@swift.org https://lists.swift.org/mailman/listinfo/swift-users