[swift-evolution] Revisiting SE-0110
Beta
rwidmann at apple.com
Thu Jun 15 17:04:43 CDT 2017
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.
~Robert Widmann
> On Jun 15, 2017, at 12:08 PM, Kyle Murray via swift-evolution <swift-evolution at swift.org> wrote:
>
> Yes, in the sense that the grammar <https://developer.apple.com/library/content/documentation/Swift/Conceptual/Swift_Programming_Language/Patterns.html#//apple_ref/doc/uid/TP40014097-CH36-ID423> has a production that permits the tuple element name. But there aren't any examples that use labels within patterns.
>
>
> GRAMMAR OF A TUPLE PATTERN
>
> <>tuple-pattern → (tuple-pattern-element-list <https://developer.apple.com/library/content/documentation/Swift/Conceptual/Swift_Programming_Language/Patterns.html#//apple_ref/swift/grammar/tuple-pattern-element-list>opt)
> <>tuple-pattern-element-list → tuple-pattern-element <https://developer.apple.com/library/content/documentation/Swift/Conceptual/Swift_Programming_Language/Patterns.html#//apple_ref/swift/grammar/tuple-pattern-element> | tuple-pattern-element <https://developer.apple.com/library/content/documentation/Swift/Conceptual/Swift_Programming_Language/Patterns.html#//apple_ref/swift/grammar/tuple-pattern-element>,tuple-pattern-element-list <https://developer.apple.com/library/content/documentation/Swift/Conceptual/Swift_Programming_Language/Patterns.html#//apple_ref/swift/grammar/tuple-pattern-element-list>
> <>tuple-pattern-element → pattern <https://developer.apple.com/library/content/documentation/Swift/Conceptual/Swift_Programming_Language/Patterns.html#//apple_ref/swift/grammar/pattern> | identifier <https://developer.apple.com/library/content/documentation/Swift/Conceptual/Swift_Programming_Language/LexicalStructure.html#//apple_ref/swift/grammar/identifier>:pattern <https://developer.apple.com/library/content/documentation/Swift/Conceptual/Swift_Programming_Language/Patterns.html#//apple_ref/swift/grammar/pattern>
> <>
>
> -Kyle
>
>> On Jun 15, 2017, at 10:34 AM, Chris Lattner via swift-evolution <swift-evolution at swift.org <mailto:swift-evolution at swift.org>> wrote:
>>
>> Is this capability even documented in TSPL?
>
> _______________________________________________
> swift-evolution mailing list
> swift-evolution at swift.org
> https://lists.swift.org/mailman/listinfo/swift-evolution
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20170615/ec624746/attachment.html>
More information about the swift-evolution
mailing list