<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">It’s not just a syntactic thing we’re talking about here. The grammar permits all kinds of wonky combinations of things that will parse as “TSPL Swift", but will fail in Sema. In that sense, no, this feature is not documented there.<div class=""><br class=""></div><div class="">~Robert Widmann<br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On Jun 15, 2017, at 12:08 PM, Kyle Murray 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; line-break: after-white-space;" class="">Yes, in the sense that <a href="https://developer.apple.com/library/content/documentation/Swift/Conceptual/Swift_Programming_Language/Patterns.html#//apple_ref/doc/uid/TP40014097-CH36-ID423" class="">the grammar</a> has a production that permits the tuple element name. But there aren't any examples that use labels within patterns.<div class=""><br class=""></div><div class=""><br class=""></div><div class=""><section class="section" style="padding: 15px 25px 30px;"><div class="syntax-defs" style="border-width: 0px 0px 0px 5px; border-left-style: solid; border-left-color: rgb(233, 233, 233); font-size: 1.4em; margin: 20px 0px; outline: 0px; padding: 0px 0px 0px 15px; vertical-align: baseline; line-height: 20.299999237060547px;"><p class="syntax-defs-name" style="border: 0px; font-size: 0.63em; margin: 0px 0px 8px; outline: 0px; padding: 0px; vertical-align: baseline; color: rgb(128, 128, 128); letter-spacing: 2px; text-transform: uppercase;">GRAMMAR OF A TUPLE PATTERN</p><div class="syntax-defs-group" style="border: 0px; font-size: 14px; margin: 0px 0px 12px; outline: 0px; padding: 0px; vertical-align: baseline;"><div style="border: 0px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;" class=""><a name="//apple_ref/swift/grammar/tuple-pattern" style="border: 0px; margin: -85px 0px 0px; outline: 0px; padding: 85px 0px 0px; vertical-align: baseline; display: block; width: 0px; height: 0px; color: rgb(0, 136, 204);" class=""></a><span class="syntax-def-name" style="border: 0px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline; color: rgb(128, 128, 128); font-style: italic;">tuple-pattern </span><span class="arrow" style="border: 0px; margin: 0px; outline: 0px; padding: 0px 0px 0px 4px; vertical-align: baseline; color: rgb(128, 128, 128);">→ </span><code class="literal" style="border: 0px; font-size: 0.86em; margin: 0px; outline: 0px; padding: 0px 4px; vertical-align: baseline; font-family: Menlo, monospace; font-weight: 600; word-wrap: break-word;">(</code><span class="optional" style="border: 0px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"><span class="syntactic-cat" style="border: 0px; margin: 0px; outline: 0px; padding: 0px 4px; vertical-align: baseline; font-style: italic; word-break: keep-all;"><a href="https://developer.apple.com/library/content/documentation/Swift/Conceptual/Swift_Programming_Language/Patterns.html#//apple_ref/swift/grammar/tuple-pattern-element-list" data-renderer-version="2" data-id="//apple_ref/swift/grammar/tuple-pattern-element-list" style="border: 0px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline; color: rgb(0, 136, 204); text-decoration: none;" class="">tuple-pattern-element-list</a></span><sub class="subscript" style="border: 0px; font-size: 0.8em; margin: 0px 0px 0px -2px; outline: 0px; padding: 0px 4px 0px 0px; color: rgb(128, 128, 128); font-style: italic;">opt</sub></span><code class="literal" style="border: 0px; font-size: 0.86em; margin: 0px; outline: 0px; padding: 0px 4px; vertical-align: baseline; font-family: Menlo, monospace; font-weight: 600; word-wrap: break-word;">)</code></div><div style="border: 0px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;" class=""><a name="//apple_ref/swift/grammar/tuple-pattern-element-list" style="border: 0px; margin: -85px 0px 0px; outline: 0px; padding: 85px 0px 0px; vertical-align: baseline; display: block; width: 0px; height: 0px; color: rgb(0, 136, 204);" class=""></a><span class="syntax-def-name" style="border: 0px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline; color: rgb(128, 128, 128); font-style: italic;">tuple-pattern-element-list </span><span class="arrow" style="border: 0px; margin: 0px; outline: 0px; padding: 0px 0px 0px 4px; vertical-align: baseline; color: rgb(128, 128, 128);">→ </span><span class="alternative" style="border: 0px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline; display: inline;"><span class="syntactic-cat" style="border: 0px; margin: 0px; outline: 0px; padding: 0px 4px; vertical-align: baseline; font-style: italic; word-break: keep-all;"><a href="https://developer.apple.com/library/content/documentation/Swift/Conceptual/Swift_Programming_Language/Patterns.html#//apple_ref/swift/grammar/tuple-pattern-element" data-renderer-version="2" data-id="//apple_ref/swift/grammar/tuple-pattern-element" style="border: 0px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline; color: rgb(0, 136, 204); text-decoration: none;" class="">tuple-pattern-element</a> |</span> </span><span class="alternative" style="border: 0px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline; display: inline;"><span class="syntactic-cat" style="border: 0px; margin: 0px; outline: 0px; padding: 0px 4px; vertical-align: baseline; font-style: italic; word-break: keep-all;"><a href="https://developer.apple.com/library/content/documentation/Swift/Conceptual/Swift_Programming_Language/Patterns.html#//apple_ref/swift/grammar/tuple-pattern-element" data-renderer-version="2" data-id="//apple_ref/swift/grammar/tuple-pattern-element" style="border: 0px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline; color: rgb(0, 136, 204); text-decoration: none;" class="">tuple-pattern-element</a></span><code class="literal" style="border: 0px; font-size: 0.86em; margin: 0px; outline: 0px; padding: 0px 4px; vertical-align: baseline; font-family: Menlo, monospace; font-weight: 600; word-wrap: break-word;">,</code><span class="syntactic-cat" style="border: 0px; margin: 0px; outline: 0px; padding: 0px 4px; vertical-align: baseline; font-style: italic; word-break: keep-all;"><a href="https://developer.apple.com/library/content/documentation/Swift/Conceptual/Swift_Programming_Language/Patterns.html#//apple_ref/swift/grammar/tuple-pattern-element-list" data-renderer-version="2" data-id="//apple_ref/swift/grammar/tuple-pattern-element-list" style="border: 0px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline; color: rgb(0, 136, 204); text-decoration: none;" class="">tuple-pattern-element-list</a></span></span></div><div style="border: 0px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;" class=""><a name="//apple_ref/swift/grammar/tuple-pattern-element" style="border: 0px; margin: -85px 0px 0px; outline: 0px; padding: 85px 0px 0px; vertical-align: baseline; display: block; width: 0px; height: 0px; color: rgb(0, 136, 204);" class=""></a><span class="syntax-def-name" style="border: 0px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline; color: rgb(128, 128, 128); font-style: italic;">tuple-pattern-element </span><span class="arrow" style="border: 0px; margin: 0px; outline: 0px; padding: 0px 0px 0px 4px; vertical-align: baseline; color: rgb(128, 128, 128);">→ </span><span class="alternative" style="border: 0px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline; display: inline;"><span class="syntactic-cat" style="border: 0px; margin: 0px; outline: 0px; padding: 0px 4px; vertical-align: baseline; font-style: italic; word-break: keep-all;"><a href="https://developer.apple.com/library/content/documentation/Swift/Conceptual/Swift_Programming_Language/Patterns.html#//apple_ref/swift/grammar/pattern" data-renderer-version="2" data-id="//apple_ref/swift/grammar/pattern" style="border: 0px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline; color: rgb(0, 136, 204); text-decoration: none;" class="">pattern</a> |</span> </span><span class="alternative" style="border: 0px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline; display: inline;"> <span class="syntactic-cat" style="border: 0px; margin: 0px; outline: 0px; padding: 0px 4px; vertical-align: baseline; font-style: italic; word-break: keep-all;"><a href="https://developer.apple.com/library/content/documentation/Swift/Conceptual/Swift_Programming_Language/LexicalStructure.html#//apple_ref/swift/grammar/identifier" data-renderer-version="2" data-id="//apple_ref/swift/grammar/identifier" style="border: 0px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline; color: rgb(0, 136, 204); text-decoration: none;" class="">identifier</a></span><code class="literal" style="border: 0px; font-size: 0.86em; margin: 0px; outline: 0px; padding: 0px 4px; vertical-align: baseline; font-family: Menlo, monospace; font-weight: 600; word-wrap: break-word;">:</code><span class="syntactic-cat" style="border: 0px; margin: 0px; outline: 0px; padding: 0px 4px; vertical-align: baseline; font-style: italic; word-break: keep-all;"><a href="https://developer.apple.com/library/content/documentation/Swift/Conceptual/Swift_Programming_Language/Patterns.html#//apple_ref/swift/grammar/pattern" data-renderer-version="2" data-id="//apple_ref/swift/grammar/pattern" style="border: 0px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline; color: rgb(0, 136, 204); text-decoration: none;" class="">pattern</a></span></span></div></div></div></section><section class="section" style="padding: 15px 25px 30px;"><a name="//apple_ref/doc/uid/TP40014097-CH36-ID424" style="border: 0px; font-size: 10px; margin: -85px 0px 0px; outline: 0px; padding: 85px 0px 0px; vertical-align: baseline; display: block; width: 0px; height: 0px; color: rgb(0, 136, 204); font-family: Helvetica, Arial, sans-serif;" class=""></a></section></div><div class=""><br class=""></div><div class="">-Kyle<br class=""><div class=""><br class=""><blockquote type="cite" class=""><div class="">On Jun 15, 2017, at 10:34 AM, Chris Lattner 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=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">Is this capability even documented in TSPL?</span></div></blockquote></div><br class=""></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=""></div></body></html>