On May 25, 2016, at 2:55 PM, Matthew Johnson <[email protected]> wrote: > > >> On May 25, 2016, at 3:48 PM, Jacob Bandes-Storch via swift-evolution >> <[email protected] <mailto:[email protected]>> wrote: >> >> I like this pretty well, and I think "with()" makes sense as a peer of >> "withUnsafePointer()", "withExtendedLifetime()", etc. >> >> I'd also be okay with waiting for a comprehensive method-cascading solution. >> I don't find this issue particularly urgent, because it's pretty easily >> solvable with an extension or just using closures. > > +1. I’ve been playing around with it in my own code a little bit. I’m still > uncertain about when I think it is good style and when I think it is best > avoided. I would certainly feel more comfortable using it if it was in the > standard library. > > At the same time, I think we can and should do better in the future. If that > is the plan, do we really want `with` in the standard library? I don’t mind > waiting for a better solution, especially if it means a better solution is > more likely to happen and / or we aren’t left with an unnecessary and > duplicative function in the standard library. > > So I’m on the fence here.
I wouldn't be pushing if I thought it wouldn't be useful after cascading. If no other reason, it offers a way to duplicate/modify value types to be stored into constants. That alone should argue for its value. -- E
_______________________________________________ swift-evolution mailing list [email protected] https://lists.swift.org/mailman/listinfo/swift-evolution
