<div style="white-space:pre-wrap">Likely not the best wording on my part... It by definition can&#39;t escape but the coder may find they need it to conceptually escape / persist which then leads to mapping it to some other form that captures the same or similar state.<br><br>Anyway I meant to say I like it and generally support the addition. I only question if the utility of it may be too limited.<br><br>I will play around in code examples to better clarify my thinking on this.</div><br><div class="gmail_quote"><div dir="ltr">On Mon, Feb 22, 2016 at 9:22 AM Erica Sadun &lt;<a href="mailto:erica@ericasadun.com">erica@ericasadun.com</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div>Under what circumstances could these ever escape scope?</div></div><div style="word-wrap:break-word"><div><br></div><div>-- E</div></div><div style="word-wrap:break-word"><br><div><blockquote type="cite"><div>On Feb 22, 2016, at 10:20 AM, Shawn Erickson &lt;<a href="mailto:shawnce@gmail.com" target="_blank">shawnce@gmail.com</a>&gt; wrote:</div><br><div>I have similar concerns as David. I do like the idea but I see it becoming a problem in not a typical usage as David outlined. You likely would never want to use this in any public API or possibly any function signature for that matter (again given the limits implied by the short hand). I see it being useful in a given scope of code for the purpose of readability and even safety. It is when it starts to escape that scope it become less useful and possibly unsafe.<br><br><div class="gmail_quote"><div dir="ltr">On Mon, Feb 22, 2016 at 9:12 AM David Waite via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div>Having this work similar to other anonymous types would be an extension to the proposal. </div><div><br></div><div>Other anonymous types can be considered equivalent by their definitions, e.g. (x:Int, y:Int) taken as input from one function can be passed to another. </div><div><br></div><div>E.g. your adjustTemperature function wanted to call a checkSafety(device:DeviceType, [low | medium | high]:temperature) -&gt; Bool function - could it?</div><div><br></div><div>what about if adjustTemperature took [low | medium | high | extreme]?</div><div><br></div><div>what about adjustTemperature having an internal var lastAdjustment:[low | medium | high] - would that work?</div><div><br></div><div>My concern is that there could many reasons to need to switch from shorthand/anonymous syntax to a full enum, and that switch will have the same fragility as changing a function from accepting a tuple to accepting a struct. If passing to another function or assigning to a variable would require a switch to a properly qualified enum, the feature seems not worth its character savings.</div><div><br></div><div>And I’m already unsure it is worth its existing character savings, especially once you start documenting the meaning of low / medium / high for other developers, and especially if you now have to do so for multiple functions rather than a single enum declaration.</div></div><div style="word-wrap:break-word"><div><br></div><div>-DW</div></div><div style="word-wrap:break-word"><div><br></div><div><blockquote type="cite"><div>On Feb 22, 2016, at 9:46 AM, Erica Sadun via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>&gt; wrote:</div><br><div><div style="word-wrap:break-word"><br><div><blockquote type="cite"><div>On Feb 22, 2016, at 3:53 AM, Tino Heth via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>&gt; wrote:</div><br><div><div>I&#39;m not sure wether I want to see that feature added, but I think there is a &quot;structural&quot; argument for it:<br>We have anonymous functions (closures) and a (restricted) form of anonymous structs (tuples), so it would be consequent to have a anonymous variant for each fundamental entity in the language.<br>I guess it is to late to establish a unified syntax for all of those, though…<br></div></div></blockquote></div><br><div>I like the symmetry with the other anonymous types. This provides a highly focused tweak to Swift, with limited impact, and a measurable benefit to developers. (AKA the &quot;Rule of Lattner&quot;)</div><div><br></div><div>Further, the values cannot be assigned to variables or passed as arguments as they have no &quot;type&quot;.  I suspect it won&#39;t be hard to restrict them for being used with `Any` argument, limiting their use to flags and switch cases. If I&#39;m conceptualizing this correctly, the benefits are clear and the consequences are small.</div><div><br></div><div>-- Erica</div><div><br></div><div><blockquote type="cite"><div>On Feb 21, 2016, at 11:52 PM, Yong hee Lee via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>&gt; wrote:</div><br><div><div style="word-wrap:break-word"><div><br></div><div>please check the link below.</div><div><br></div><div><a href="https://gist.github.com/erica/9148e2be916c7fae6f1e" target="_blank">https://gist.github.com/erica/9148e2be916c7fae6f1e</a></div><div><br></div></div></div></blockquote></div><div><div><br></div></div></div>_______________________________________________<br>swift-evolution mailing list<br><a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a><br><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" target="_blank">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br></div></blockquote></div><br></div>_______________________________________________<br>
swift-evolution mailing list<br>
<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a><br>
<a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="noreferrer" target="_blank">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br>
</blockquote></div>
</div></blockquote></div><br></div></blockquote></div>