<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div></div><div>I'm not sure I fully understand the value proposition of having all those different kinds of literals, but one piece of feedback I have on that is the previously established format for the # notation should be #camelCase rather than #dot.separated.</div><div><br>On Dec 16, 2016, at 5:41 PM, Erica Sadun &lt;<a href="mailto:erica@ericasadun.com">erica@ericasadun.com</a>&gt; wrote:<br><br></div><blockquote type="cite"><div><meta http-equiv="Content-Type" content="text/html charset=utf-8"><div class="">Take a peek at this:&nbsp;<a href="https://gist.github.com/erica/c92f6ab115af89d5c4b9161487df6a3c" class="">https://gist.github.com/erica/c92f6ab115af89d5c4b9161487df6a3c</a></div><div class=""><br class=""></div><div class="">--E</div><br class=""><div><blockquote type="cite" class=""><div class="">On Dec 16, 2016, at 2:58 PM, Micah Hainline via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="">Charles,<br class=""><br class="">There's already something like that for file URLs in a playground,<br class="">though I'm not sure about compile-time checking or how that might work<br class="">outside of playgrounds.<br class=""><br class=""><a href="https://lists.swift.org/pipermail/swift-evolution-announce/2016-March/000060.html" class="">https://lists.swift.org/pipermail/swift-evolution-announce/2016-March/000060.html</a><br class=""><br class="">Of course, my proposal would work fine for file URLs, just not for<br class="">turning file paths INTO URLs.<br class=""><br class="">On Fri, Dec 16, 2016 at 3:05 PM, Charles Srstka<br class="">&lt;<a href="mailto:cocoadev@charlessoft.com">cocoadev@charlessoft.com</a>&gt; wrote:<br class=""><blockquote type="cite" class=""><blockquote type="cite" class="">On Dec 16, 2016, at 2:46 PM, Micah Hainline via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a>&gt; wrote:<br class=""><br class="">I would like to be able to create a URL literal that is compile-time<br class="">checked for correct format. This would help avoid code like this:<br class=""><br class=""> &nbsp;&nbsp;let url: URL = URL(string: "<a href="https://example.com">https://example.com</a>")!<br class=""><br class="">The cleanest way I can think of doing that would be to introduce a new<br class="">macro structure similar to #selector, though I'm open to other ideas.<br class="">I would think it should take a quoted literal string to avoid<br class="">problems. That would look like this:<br class=""><br class=""> &nbsp;&nbsp;let url: URL = #url("<a href="https://example.com">https://example.com</a>")<br class=""><br class="">What does everyone think of that idea?<br class="">_______________________________________________<br class="">swift-evolution mailing list<br class=""><a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a><br class=""><a href="https://lists.swift.org/mailman/listinfo/swift-evolution">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br class=""></blockquote><br class=""><br class="">I’d like to see something like that for file path URLs. For something so commonly used, URL(fileURLWithPath:) is obnoxiously verbose.<br class=""><br class="">Charles<br class=""><br class=""></blockquote>_______________________________________________<br class="">swift-evolution mailing list<br class=""><a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a><br class=""><a href="https://lists.swift.org/mailman/listinfo/swift-evolution">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br class=""></div></div></blockquote></div><br class=""></div></blockquote></body></html>