[swift-evolution] What about a VBA style with Statement?

Vladimir.S svabox at gmail.com
Mon Apr 18 10:16:04 CDT 2016

Agree. Such construction is also very useful. +1 to implement it.

 From one side we know, that we should name variables with meaningful 
names. From other side, the longer the name of variable - the more noise 
you see in code and in some cases this noise,copy-paste,ide completion 
suggestions produce bugs in code when you need a lot of assignments/actions 
for one/two particular instance(s).
So IMO such "with" produces less errors and is clear.

Please provide your opinions on this.

On 15.04.2016 3:47, Dany St-Amant via swift-evolution wrote:
> Thought with a free standing 'with' the next request to come in, could be to be able to do something like:
> with source, destination {
>   $1.something = $0.somethingSimilar
>   $1.x = $0.bound.left
>   $1.y = $0.point.top
> }
> So using $0,  may be a future proofing option.
> Dany

More information about the swift-evolution mailing list