[swift-evolution] [Discussion] Modernizing Playground Literals

Erica Sadun erica at ericasadun.com
Tue Feb 16 12:45:26 CST 2016


> On Feb 16, 2016, at 10:31 AM, Daniel Vollmer via swift-evolution <swift-evolution at swift.org> wrote:
> 
> 
>> On 15 Feb 2016, at 21:16, Erica Sadun via swift-evolution <swift-evolution at swift.org> wrote:
>> 
>> Presented for discussion and feedback. Thank you in advance for your thoughts.
>> 
>> -- Erica
>> 
>> Modernizing Playground Literals
> 
> [snip]
> 
> 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.
> 
> 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?
> 
> 	Daniel.

It's certainly beyond the scope of this proposal.  I'm not sure if it passes the Lattner test: "Is there a clear, measurable, immediate benefit to Swift developers rather than being of value for its cleverness?" There'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.

-- Erica



More information about the swift-evolution mailing list