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

Vladimir.S svabox at gmail.com
Wed Apr 13 12:12:29 CDT 2016


On 13.04.2016 19:48, Erica Sadun wrote:
 > My version of `with` doesn't have this issue. However, it's a clear 
logical error on the programmer's part when you treat a value type as a 
reference type.

Could you provide your 'with' function please?(checked last emails - can't 
find) Right now it is not clear for me how this problem could be resolved.

As for your notes about "value/reference".. Could you describe with more 
details?
In my example, I want to show that with this 'with' function you can 
compile code that tries to change constant of value(struct) type. Let say 
just by mistake, i.e. initially you wanted to just get values of this 
struct constant.
So this 'with' function should be treated as hack, not as a good solution 
for 'with' feature. (yes, for reference type it should work OK)



More information about the swift-evolution mailing list