<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 Jun 24, 2016, at 3:06 PM, Xiaodi Wu <<a href="mailto:xiaodi.wu@gmail.com" class="">xiaodi.wu@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><br class="Apple-interchange-newline"><br style="font-family: Helvetica; font-size: 12px; 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="gmail_quote" style="font-family: Helvetica; font-size: 12px; 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;">On Fri, Jun 24, 2016 at 2:50 PM, Matthew Johnson via swift-evolution<span class="Apple-converted-space"> </span><span dir="ltr" class=""><<a href="mailto:swift-evolution@swift.org" target="_blank" class="">swift-evolution@swift.org</a>></span><span class="Apple-converted-space"> </span>wrote:<br class=""><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex;"><div style="word-wrap: break-word;" class=""><br class=""><div class=""><span class=""><blockquote type="cite" class=""><div class="">On Jun 24, 2016, at 10:41 AM, Adrian Zubarev via swift-evolution <<a href="mailto:swift-evolution@swift.org" target="_blank" class="">swift-evolution@swift.org</a>> wrote:</div><br class=""><div class=""><div style="font-family: Helvetica, Arial; font-size: 13px; font-style: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; background-color: rgb(254, 254, 254);" class=""><p style="margin: 15px 0px;" class="">That said, how about this design:</p><pre style="margin: 15px 0px; font-family: Menlo, Consolas, 'Liberation Mono', Courier, monospace; font-size: 10pt; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: rgb(248, 248, 248); color: inherit; border: 1px solid rgb(204, 204, 204); overflow: auto; padding: 4px 8px; word-break: normal; word-wrap: normal;" class=""><code style="font-family: Menlo, Consolas, 'Liberation Mono', Courier, monospace; font-size: 10pt; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: rgb(248, 248, 248); color: inherit; border: 0px; margin: 0px; padding: 0px; word-break: normal; word-wrap: normal;" class="">public protocol _LiteralNilProtocol { … }
…
public enum Literal {
public typealias NilProtocol = …
…
}</code></pre></div></div></blockquote></span>I’m pretty sure the standard library team intends to reserve the right to use this namespace for other protocols that only exist for syntactic support. This may not always be literals - there may be other kinds of syntax supporting protocols in the future. With that in mind I don’t think this design will work.</div></div></blockquote><div class=""><br class=""></div><div class="">That said, `IntegerLiteralProtocol` or `Syntax.IntegerLiteralProtocol` both read very nicely, IMO, so that aspect of the idea is worth considering.</div></div></div></blockquote><div><br class=""></div><div>Yes, I have incorporated these into the alternatives section of the proposal. I appreciate your suggestions!</div><div><br class=""></div><div>I’ll be submitting a PR later today or tomorrow if no significant new feedback arises. </div><br class=""><blockquote type="cite" class=""><div class=""><div class="gmail_quote" style="font-family: Helvetica; font-size: 12px; 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;"><div class=""> </div><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex;"><div style="word-wrap: break-word;" class=""><div class=""><div class=""><div class="h5"><br class=""><blockquote type="cite" class=""><div class=""><div style="font-family: Helvetica, Arial; font-size: 13px; font-style: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; background-color: rgb(254, 254, 254);" class=""><pre style="margin: 15px 0px; font-family: Menlo, Consolas, 'Liberation Mono', Courier, monospace; font-size: 10pt; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: rgb(248, 248, 248); color: inherit; border: 1px solid rgb(204, 204, 204); overflow: auto; padding: 4px 8px; word-break: normal; word-wrap: normal;" class=""><code style="font-family: Menlo, Consolas, 'Liberation Mono', Courier, monospace; font-size: 10pt; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: rgb(248, 248, 248); color: inherit; border: 0px; margin: 0px; padding: 0px; word-break: normal; word-wrap: normal;" class="">extension Array: Literal.ArrayProtocol
</code></pre><div style="margin: 15px 0px;" class=""><br class=""></div></div><div style="font-family: Helvetica, Arial; font-size: 13px; font-style: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; background-color: rgb(254, 254, 254);" class=""><div style="font-family: Helvetica, Arial; font-size: 13px; margin: 0px;" class=""><br class=""></div><br class=""><div class=""><div style="font-family: helvetica, arial; font-size: 13px;" class="">-- <br class="">Adrian Zubarev<br class="">Sent with Airmail</div></div><br class=""><p style="margin: 15px 0px;" class="">Am 24. Juni 2016 um 17:37:27, Adrian Zubarev (<a href="mailto:adrian.zubarev@devandartist.com" target="_blank" style="color: rgb(65, 131, 196); background-color: inherit; text-decoration: none;" class="">adrian.zubarev@devandartist.com</a>) schrieb:</p><blockquote type="cite" style="margin: 15px 0px;" class=""><span style="margin-top: 0px; margin-bottom: 0px;" class=""><div style="word-wrap: break-word;" class=""><div class=""></div><div class=""><div class=""><p style="margin: 15px 0px;" class="">Really? I must have overlooked that some pitched that design.</p><p style="margin: 15px 0px;" class="">Okay now that I think through this whole scenario, I like the underscore iff there is a good name that will be present in the final version.</p><p style="margin: 15px 0px;" class="">When Swift 3 drops, I’ll write a proposal for nested protocols which will refine your design (the original author went missing after pitching this idea, and Joe Groff told me that this probably out of scope for Swift 3)!</p><p style="margin: 15px 0px;" class="">Your current design might become this in Swift 3.X and all protocols marked with an underscore will disappear:</p><pre style="margin: 15px 0px; font-family: Menlo, Consolas, 'Liberation Mono', Courier, monospace; font-size: 10pt; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: rgb(248, 248, 248); color: inherit; border: 1px solid rgb(204, 204, 204); overflow: auto; padding: 4px 8px; word-break: normal; word-wrap: normal;" class=""><code style="font-family: Menlo, Consolas, 'Liberation Mono', Courier, monospace; font-size: 10pt; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: rgb(248, 248, 248); color: inherit; border: 0px; margin: 0px; padding: 0px; word-break: normal; word-wrap: normal;" class="">public /* closed */ enum Syntax {
public protocol NilLiteral { ... }
public protocol BooleanLiteral { ... }
public protocol IntegerLiteral { ... }
public protocol FloatLiteral { ... }
public protocol UnicodeScalarLiteral { ... }
public protocol ExtendedGraphemeClusterLiteral { ... }
public protocol StringLiteralLiteral { ... }
public protocol StringInterplolationLiteral { ... }
public protocol ArrayrLiteral { ... }
public protocol DictionaryLiteral { ... }
}
</code></pre></div><div class=""><div style="font-family: Helvetica, Arial; font-size: 13px; margin: 0px;" class=""><br class=""></div><br class=""><div class=""><div style="font-family: helvetica, arial; font-size: 13px;" class="">-- <br class="">Adrian Zubarev<br class="">Sent with Airmail</div></div><br class=""><p style="margin: 15px 0px;" class="">Am 24. Juni 2016 um 17:25:45, Matthew Johnson (<a href="mailto:matthew@anandabits.com" target="_blank" style="color: rgb(65, 131, 196); background-color: inherit; text-decoration: none;" class="">matthew@anandabits.com</a>) schrieb:</p><blockquote type="cite" style="margin: 15px 0px;" class=""><div style="margin-top: 0px; margin-bottom: 0px; word-wrap: break-word;" class=""><div class=""><div class=""><span class="">The design in this proposal comes from the standard library team. The intent is for the use of underscore here to be consistent with other uses of underscore prefix in the standard library. I’m not sure why you think this is different than the rest...</span></div><div class=""><span class=""><br class=""></span></div><span class=""><br class=""></span><div class=""><blockquote type="cite" style="margin: 15px 0px;" class=""><div style="margin-top: 0px;" class=""><span class="">On Jun 24, 2016, at 10:22 AM, Adrian Zubarev via swift-evolution <<a href="mailto:swift-evolution@swift.org" target="_blank" style="color: rgb(65, 131, 196); background-color: inherit; text-decoration: none;" class="">swift-evolution@swift.org</a>> wrote:</span></div><span class=""><br class=""></span><div style="margin-bottom: 0px;" class=""><div style="font-family: Helvetica, Arial; font-size: 13px; font-style: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; background-color: rgb(254, 254, 254);" class=""><p style="margin: 15px 0px;" class=""><span class="">I’m aware of that fact, but all types with underscore even in the stdlib telling me to keep my hands of them, because something might happen to them.</span></p><div class=""><span class="">As an example we have <code style="font-family: Menlo, Consolas, 'Liberation Mono', Courier, monospace; font-size: 10pt; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: rgb(248, 248, 248); color: inherit; border: 1px solid rgb(234, 234, 234); margin: 0px 2px; padding: 0px 5px; word-break: normal; word-wrap: normal;" class="">_Strideable</code> protocol which is visible by its name, but its declaration isn’t visible at all:</span></div></div></div></blockquote><blockquote type="cite" style="margin: 15px 0px;" class=""><div style="margin-top: 0px; font-family: Helvetica, Arial; font-size: 13px; font-style: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; background-color: rgb(254, 254, 254);" class=""><pre style="margin: 15px 0px; font-family: Menlo, Consolas, 'Liberation Mono', Courier, monospace; font-size: 10pt; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: rgb(248, 248, 248); color: inherit; border: 1px solid rgb(204, 204, 204); overflow: auto; padding: 4px 8px; word-break: normal; word-wrap: normal;" class=""><span class=""><code style="font-family: Menlo, Consolas, 'Liberation Mono', Courier, monospace; font-size: 10pt; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: rgb(248, 248, 248); color: inherit; border: 0px; margin: 0px; padding: 0px; word-break: normal; word-wrap: normal;" class="">// FIXME(ABI)(compiler limitation): Remove `_Strideable`.
// WORKAROUND <a style="color: rgb(65, 131, 196); background-color: inherit; text-decoration: none;" class="">rdar://25214598</a> - should be:
// protocol Strideable : Comparable {...}
% for Self in ['_Strideable', 'Strideable']:
</code></span></pre><p style="margin: 15px 0px;" class=""><span class="">From<span class=""> </span><a href="https://github.com/apple/swift/blob/63c36dff0a327874a5041d46335bde314bc108d8/stdlib/public/core/Stride.swift.gyb" target="_blank" style="color: rgb(65, 131, 196); background-color: inherit; text-decoration: none;" class="">Stride.swift.gyb</a></span></p><div style="margin: 15px 0px;" class=""><br class=""></div></div><div style="font-family: Helvetica, Arial; font-size: 13px; font-style: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; background-color: rgb(254, 254, 254);" class=""><div style="font-family: Helvetica, Arial; font-size: 13px; margin: 0px;" class=""><br class=""></div><br class=""><div class=""><div style="font-family: helvetica, arial; font-size: 13px;" class="">-- <br class="">Adrian Zubarev<br class="">Sent with Airmail</div></div><br class=""><p style="margin: 15px 0px;" class="">Am 24. Juni 2016 um 17:09:53, Matthew Johnson (<a href="mailto:matthew@anandabits.com" target="_blank" style="color: rgb(65, 131, 196); background-color: inherit; text-decoration: none;" class="">matthew@anandabits.com</a>) schrieb:</p><blockquote type="cite" style="margin: 15px 0px;" class=""><div style="margin-top: 0px; margin-bottom: 0px;" class=""><span style="margin-top: 0px; margin-bottom: 0px;" class=""><span style="font-family: 'helvetica Neue', helvetica; font-size: 14px; font-style: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; background-color: rgb(255, 255, 255); float: none; display: inline !important;" class="">The underscore is used in the same way it is used elsewhere in the standard library. The protocols must be public because they need to be visible to user code in order for the design to work correctly. However, they are considered implementation details that users really shouldn’t know about. This pattern is well established in the standard library.</span></span></div></blockquote></div><div style="font-family: Helvetica, Arial; font-size: 13px; font-style: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; background-color: rgb(254, 254, 254);" class=""><div style="margin: 15px 0px;" class=""><br class=""></div></div><span style="font-family: Helvetica, Arial; font-size: 13px; font-style: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; background-color: rgb(254, 254, 254); float: none; display: inline !important;" class="">_______________________________________________</span><br style="font-family: Helvetica, Arial; font-size: 13px; font-style: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; background-color: rgb(254, 254, 254);" class=""><span style="font-family: Helvetica, Arial; font-size: 13px; font-style: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; background-color: rgb(254, 254, 254); float: none; display: inline !important;" class="">swift-evolution mailing list</span><br style="font-family: Helvetica, Arial; font-size: 13px; font-style: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; background-color: rgb(254, 254, 254);" class=""><a href="mailto:swift-evolution@swift.org" target="_blank" style="color: rgb(65, 131, 196); background-color: rgb(254, 254, 254); text-decoration: none; font-family: Helvetica, Arial; font-size: 13px; font-style: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;" class="">swift-evolution@swift.org</a><br style="font-family: Helvetica, Arial; font-size: 13px; font-style: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; background-color: rgb(254, 254, 254);" class=""><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" target="_blank" style="color: rgb(65, 131, 196); background-color: rgb(254, 254, 254); text-decoration: none; font-family: Helvetica, Arial; font-size: 13px; font-style: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;" class="">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br style="margin-bottom: 0px; font-family: Helvetica, Arial; font-size: 13px; font-style: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; background-color: rgb(254, 254, 254);" class=""></blockquote></div><br class=""></div></div></blockquote></div><div class=""></div></div></div></span></blockquote></div><div style="font-family: Helvetica, Arial; font-size: 13px; font-style: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; background-color: rgb(254, 254, 254);" class=""><div style="margin: 15px 0px;" class=""><br class=""></div></div><span style="font-family: Helvetica, Arial; font-size: 13px; font-style: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; background-color: rgb(254, 254, 254); float: none; display: inline !important;" class="">_______________________________________________</span><br style="font-family: Helvetica, Arial; font-size: 13px; font-style: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; background-color: rgb(254, 254, 254);" class=""><span style="font-family: Helvetica, Arial; font-size: 13px; font-style: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; background-color: rgb(254, 254, 254); float: none; display: inline !important;" class="">swift-evolution mailing list</span><br style="font-family: Helvetica, Arial; font-size: 13px; font-style: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; background-color: rgb(254, 254, 254);" class=""><span style="font-family: Helvetica, Arial; font-size: 13px; font-style: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; background-color: rgb(254, 254, 254); float: none; display: inline !important;" class=""><a href="mailto:swift-evolution@swift.org" target="_blank" class="">swift-evolution@swift.org</a></span><br style="font-family: Helvetica, Arial; font-size: 13px; font-style: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; background-color: rgb(254, 254, 254);" class=""><span style="font-family: Helvetica, Arial; font-size: 13px; font-style: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; background-color: rgb(254, 254, 254); float: none; display: inline !important;" class=""><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" target="_blank" class="">https://lists.swift.org/mailman/listinfo/swift-evolution</a></span><br style="font-family: Helvetica, Arial; font-size: 13px; font-style: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; background-color: rgb(254, 254, 254);" class=""></div></blockquote></div></div></div><br class=""></div><br class="">_______________________________________________<br class="">swift-evolution mailing list<br class=""><a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a><br class=""><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="noreferrer" target="_blank" class="">https://lists.swift.org/mailman/listinfo/swift-evolution</a></blockquote></div></div></blockquote></div><br class=""></body></html>