[swift-evolution] Thoughts on replacing \() with $() or some other symbol

Matthew Johnson matthew at anandabits.com
Tue Jun 21 20:51:30 CDT 2016



Sent from my iPad

> On Jun 21, 2016, at 5:51 PM, Jordan Rose via swift-evolution <swift-evolution at swift.org> wrote:
> 
> 
>> On Jun 21, 2016, at 15:26, Xiaodi Wu via swift-evolution <swift-evolution at swift.org> wrote:
>> 
>>> On Tue, Jun 21, 2016 at 5:10 PM, Daniel Resnick via swift-evolution <swift-evolution at swift.org> wrote:
>>> I also disagree for the same reasons that Gwynne and Brent mentioned: I find '\(...)' easy to read, fine to type, and consistent with other string escaping syntax.
>> 
>> Those are persuasive arguments. Consistency with other string escaping syntax is a huge plus. Moreover, now that I think about it, \r or \n isn't really a bother to type. The \( combination takes a little getting used to, but it's not absurdly terrible. I suppose we could consider \{} or even \[] instead of \() to alleviate the reach.
> 
> Gwynne and Brent indeed hit on the logic for the original design: backslash is already an escape character in strings. The parentheses () over another kind of delimiter were originally to match calls (string interpolation once generated direct calls to String initializers), but even without that it’s still something that’s used with expressions, while curly braces {} are used for general code blocks and square brackets [] are used with collections.
> 
> I’m strongly in favor of keeping things the way they are, both because I like it a fair bit and because it’d be another source-breaking change that would be very hard to migrate.

+1.  I really liked this when I Swift was first released.  Using the existing escape character makes perfect sense.  We've made enough breaking changes for what are arguably aesthetic preferences.  The bar should be higher going forward and I really don't think this makes the cut.

> 
> Jordan
> 
> _______________________________________________
> swift-evolution mailing list
> swift-evolution at swift.org
> https://lists.swift.org/mailman/listinfo/swift-evolution
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160621/984e1443/attachment.html>


More information about the swift-evolution mailing list