<div id="compose" contenteditable="true" style="padding-left: 16px; padding-right: 16px; padding-bottom: 8px;"><div>I think the "<-" operator is better than ".=". This and cascade style assignment would be a good team for me. </div><div><br></div><div>object <- {</div><div> prop1: value1,</div><div> prop2: value2</div><div>}<br></div></div>
<div class="gmail_quote">_____________________________<br>From: Tino Heth via swift-evolution <<a dir="ltr" href="mailto:swift-evolution@swift.org" x-apple-data-detectors="true" x-apple-data-detectors-type="link" x-apple-data-detectors-result="0">swift-evolution@swift.org</a>><br>Sent: Monday, January 11, 2016 7:12 AM<br>Subject: Re: [swift-evolution] Draft proposal: multi-property assignment .= operator<br>To: Michel Fortin <<a dir="ltr" href="mailto:michel.fortin@michelf.ca" x-apple-data-detectors="true" x-apple-data-detectors-type="link" x-apple-data-detectors-result="3">michel.fortin@michelf.ca</a>><br>Cc: swift-evolution <<a dir="ltr" href="mailto:swift-evolution@swift.org" x-apple-data-detectors="true" x-apple-data-detectors-type="link" x-apple-data-detectors-result="4">swift-evolution@swift.org</a>><br><br><br>Methods like "setValuesForKeysWithDictionary" can indeed be very handy — but its name is quite verbose, and imho that isn't that bad:<br>It's hard to guess the meaning of ".=" (I'd prefer "<-" instead, but I guess depending on the background of the reader, this may be as hard to understand)<br><br>A method with the functionality would be nice, and the possibility of compile time checking would make it better than the variant with dictionaries — but to make the check working, this method would need special treatment by the compiler, and that would appear strange to me.<br><br>You've written about the older proposal sketches for cascading; have you seen the following idea?<br>object.{<br>        property1 = 1<br>        property2 = "a"<br>}<br>It is a less flexible in some aspect (the tuple in your draft could be created by a function call*), but is even more concise (not much, though) and can be used for more than assigning properties.<br><br>Best regards,<br>Tino<br><br>* If you continue with your draft, I suggest to explore this possibility further: With a function to turn members of an existing object into a tuple, or the option to selectively remove elements from a tuple, it could be a handy way to create copies.<br>_______________________________________________<br>swift-evolution mailing list<br><a dir="ltr" href="mailto:swift-evolution@swift.org" x-apple-data-detectors="true" x-apple-data-detectors-type="link" x-apple-data-detectors-result="5">swift-evolution@swift.org</a><br><a dir="ltr" href="https://lists.swift.org/mailman/listinfo/swift-evolution" x-apple-data-detectors="true" x-apple-data-detectors-type="link" x-apple-data-detectors-result="6">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br><br><br></div>