<div dir="ltr">I agree that a general literal syntax is beyond the scope of this proposal but, in my opinion, the &quot;clear, measurable, immediate benefit to Swift&quot; would be a means to have literal support that might not force you to accept all of the literal types inhabitants. As it stands, there are many types which are poorly served by the literal types available. If I want to use a string as a literal for my type, I must accept all possible strings (or blow up at runtime). I would gladly put in extra work to allow a literal syntax for my type that could be compile time checked. <div><br></div><div>This is not the literal syntax that I want. It is, however, the literal syntax that is within scope. </div><div><br></div><div>+1<br><div><br></div><div><br></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Feb 16, 2016 at 1:45 PM, Erica Sadun via swift-evolution <span dir="ltr">&lt;<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class=""><br>
&gt; On Feb 16, 2016, at 10:31 AM, Daniel Vollmer via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a>&gt; wrote:<br>
&gt;<br>
&gt;<br>
&gt;&gt; On 15 Feb 2016, at 21:16, Erica Sadun via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a>&gt; wrote:<br>
&gt;&gt;<br>
&gt;&gt; Presented for discussion and feedback. Thank you in advance for your thoughts.<br>
&gt;&gt;<br>
&gt;&gt; -- Erica<br>
&gt;&gt;<br>
&gt;&gt; Modernizing Playground Literals<br>
&gt;<br>
&gt; [snip]<br>
&gt;<br>
&gt; Ignoring the fact that I think Erica’s proposal is an improvement over the current state, a more general solution would be something like user-defined literals in C++11 (with whatever syntax). A playground could then pre-import the definitions of any literal types it wants to support, without having to change the language / compiler any time a new literal type is added.<br>
&gt;<br>
&gt; I’m not sure whether this use-case is so important (or I’m overlooking something basic) that these items need such special treatment (e.g. #-prefix); couldn’t one just offer global factory functions for the literals in question and treat them specifically in Xcode’s playground UI?<br>
&gt;<br>
&gt;       Daniel.<br>
<br>
</span>It&#39;s certainly beyond the scope of this proposal.  I&#39;m not sure if it passes the Lattner test: &quot;Is there a clear, measurable, immediate benefit to Swift developers rather than being of value for its cleverness?&quot; There&#39;s also a general macro system that I know keeps coming up on these threads that ??Dave Abrahams?? is working on for Swift 4 or later.<br>
<span class="HOEnZb"><font color="#888888"><br>
-- Erica<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
_______________________________________________<br>
swift-evolution mailing list<br>
<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a><br>
<a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="noreferrer" target="_blank">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br>
</div></div></blockquote></div><br></div>