[swift-evolution] [Pitch] Circling back to `with`
Dany St-Amant
dsa.mls at icloud.com
Wed May 25 18:34:38 CDT 2016
> Le 25 mai 2016 à 14:28, Erica Sadun via swift-evolution <swift-evolution at swift.org> a écrit :
>
> Over the past couple of days, the Twitters have discovered some work I'd done on closure-based setup.
> It's clear that a demand is out there and strong for this kind of behavior, even without implicit `self` as
> part of the mix or cascading. In that light, I've put together the following:
>
> https://gist.github.com/erica/96d9c5bb4eaa3ed3b2ff82dc35aa8dae
>
> If the community demand is this high, I think we should re-consider pushing it before 3.
> Feedback as always welcome, including criticism.
Recently there was another possible 'with' variant:
- instead of being a: with 'instance' create new 'instance' using 'closure'
- it was a: with(/on) 'instance/s' perform 'closure' (same idea as the closure-based initialization, described in the motivation)
The thread "What about a VBA style with Statement?": http://thread.gmane.org/gmane.comp.lang.swift.evolution/14384
In either case the 'with' can be misleading/confusing; with, on its own doesn't suggest creation of a new entity, nor does it strongly suggest possible mutation.
Just mentioning it as to end up... with the proper name for this new function.
Dany
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160525/6ad04908/attachment.html>
More information about the swift-evolution
mailing list