<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On May 25, 2016, at 4:31 PM, Erica Sadun <<a href="mailto:erica@ericasadun.com" class="">erica@ericasadun.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html charset=us-ascii" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div class=""><blockquote type="cite" class=""><div class="">On May 25, 2016, at 3:29 PM, Matthew Johnson <<a href="mailto:matthew@anandabits.com" class="">matthew@anandabits.com</a>> wrote:</div><div class=""><div style="font-family: Palatino-Roman; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">On May 25, 2016, at 3:56 PM, Erica Sadun <<a href="mailto:erica@ericasadun.com" class="">erica@ericasadun.com</a>> wrote:<br class=""></div><blockquote type="cite" style="font-family: Palatino-Roman; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><div class=""><div class="">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.</div></div></blockquote><div style="font-family: Palatino-Roman; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br class=""></div><span style="font-family: Palatino-Roman; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">Can you point us to the latest draft of what you have in mind for cascading in the future? </span></div></blockquote><br class=""></div><div class="">Haven't really touched it since I got the "sit and wait" but I've come around to preferring Dartism.</div></div></div></blockquote><div><br class=""></div><div>Got it. I just looked up how Dart does this to refresh my memory. </div><div><br class=""></div><div>Are there cases where you think `with` would be a better option than method cascading other than the copy scenario? </div><div><br class=""></div><div>I think there are several ways we could handle the “copy and modify a value type” use case better than `with`. The most obvious: if the primary reason for `with` to exist post-method cascading is to introduce a copy, I would prefer a `copy` function that could be used in conjunction with method cascading (which would then mutate and return the copy rather than the initial instance).</div><div><br class=""></div><div>Brent’s example would go from:</div><div><br class=""></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>extension FloatingPoint {<br class=""><span class="Apple-tab-span" style="white-space:pre">        </span><span class="Apple-tab-span" style="white-space:pre">        </span>func adding(_ other: Self) -> Self {<br class=""><span class="Apple-tab-span" style="white-space:pre">        </span><span class="Apple-tab-span" style="white-space:pre">        </span><span class="Apple-tab-span" style="white-space:pre">        </span>return with(self) { $0.add(other) }<br class=""><span class="Apple-tab-span" style="white-space:pre">        </span><span class="Apple-tab-span" style="white-space:pre">        </span>}<br class=""><span class="Apple-tab-span" style="white-space:pre">        </span>}</div><div><br class=""></div><div>to: </div><div><br class=""></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>extension FloatingPoint {<br class=""><span class="Apple-tab-span" style="white-space:pre">        </span><span class="Apple-tab-span" style="white-space:pre">        </span>func adding(_ other: Self) -> Self {<br class=""><span class="Apple-tab-span" style="white-space:pre">        </span><span class="Apple-tab-span" style="white-space:pre">        </span><span class="Apple-tab-span" style="white-space:pre">        </span>return copy(self)..add(other)<br class=""><span class="Apple-tab-span" style="white-space:pre">        </span><span class="Apple-tab-span" style="white-space:pre">        </span>}<br class=""><span class="Apple-tab-span" style="white-space:pre">        </span>}</div><div><br class=""></div><div>This reads much better than the former IMO.</div><div><br class=""></div><div>I’m interested in hearing about use cases where `with` is superior to method cascading plus `copy`. I think that is the minimum bar that should be crossed if we’re going to add this to the standard library. </div><div><br class=""></div><div>I’m not opposed to it on principle, but I want to make sure it carries its weight long term if we put it in the standard library. It’s easy enough to copy into our projects if it’s not there and we feel the need to use it.</div><div><br class=""></div><br class=""><blockquote type="cite" class=""><div class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class=""><br class=""></div><div class="">-- E</div><div class=""><br class=""></div><br class=""></div></div></blockquote></div><br class=""></body></html>