[swift-evolution] Strings in Swift 4

clattner at nondot.org clattner at nondot.org
Wed Jan 25 19:49:41 CST 2017


> On Jan 25, 2017, at 1:10 PM, Dave Abrahams via swift-evolution <swift-evolution at swift.org> wrote:
> 
>> I also prefer #1.  It’s a shame that this conflicts with the potential
>> syntax for variadic generics.  Is there really no way around this?
>> I’m showing my ignorance on compilers here, but couldn’t the fact that
>> variadic generics will be inside angle brackets be used to
>> distinguish?
> 
> The variadic use cases don't always have ... appearing inside angle
> brackets.  See “pack expansion” at
> http://en.cppreference.com/w/cpp/language/parameter_pack <http://en.cppreference.com/w/cpp/language/parameter_pack>
> for example.

AFAIK, we have no serious / concrete design proposal for variadic generics, so it remains unclear to me that we would syntactically follow the C++ model.  The C++ model seems very influenced by its instantiation based approach.

In any case, it seems like an obviously good tradeoff to make the syntax for variadic generics more complicated if it makes one sided ranges more beautiful.

-Chris

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20170125/6ed6aa04/attachment.html>


More information about the swift-evolution mailing list