<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=""><div class="">Having this work similar to other anonymous types would be an extension to the proposal. </div><div class=""><br class=""></div><div class="">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 class=""><br class=""></div><div class="">E.g. your adjustTemperature function wanted to call a checkSafety(device:DeviceType, [low | medium | high]:temperature) -> Bool function - could it?</div><div class=""><br class=""></div><div class="">what about if adjustTemperature took [low | medium | high | extreme]?</div><div class=""><br class=""></div><div class="">what about adjustTemperature having an internal var lastAdjustment:[low | medium | high] - would that work?</div><div class=""><br class=""></div><div class="">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 class=""><br class=""></div><div class="">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 class=""><br class=""></div><div class="">-DW</div><div class=""><br class=""></div><div><blockquote type="cite" class=""><div class="">On Feb 22, 2016, at 9:46 AM, Erica Sadun via swift-evolution <<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html charset=utf-8" 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 Feb 22, 2016, at 3:53 AM, Tino Heth via swift-evolution <<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="">I'm not sure wether I want to see that feature added, but I think there is a "structural" argument for it:<br class="">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 class="">I guess it is to late to establish a unified syntax for all of those, though…<br class=""></div></div></blockquote></div><br class=""><div class="">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 "Rule of Lattner")</div><div class=""><br class=""></div><div class="">Further, the values cannot be assigned to variables or passed as arguments as they have no "type". I suspect it won't be hard to restrict them for being used with `Any` argument, limiting their use to flags and switch cases. If I'm conceptualizing this correctly, the benefits are clear and the consequences are small.</div><div class=""><br class=""></div><div class="">-- Erica</div><div class=""><br class=""></div><div class=""><blockquote type="cite" class=""><div class="">On Feb 21, 2016, at 11:52 PM, Yong hee Lee via swift-evolution <<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="" style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div class=""><br class=""></div><div class="">please check the link below.</div><div class=""><br class=""></div><div class=""><a href="https://gist.github.com/erica/9148e2be916c7fae6f1e" class="">https://gist.github.com/erica/9148e2be916c7fae6f1e</a></div><div class=""><br class=""></div></div></div></blockquote></div><div class=""><div class=""><br class=""></div></div></div>_______________________________________________<br class="">swift-evolution mailing list<br class=""><a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a><br class="">https://lists.swift.org/mailman/listinfo/swift-evolution<br class=""></div></blockquote></div><br class=""></body></html>