<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On 21 Jun 2016, at 22:49, Gwynne Raskind via swift-evolution <<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><blockquote type="cite" class=""><div class="">On Jun 21, 2016, at 15:48, Jonathan Cotton via swift-evolution <<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="">I'd support $() as is in use by other languages, including Kotlin, as mentioned it seems less disruptive and more inline with the tokenised parameters that are already supported in closures.<br class=""><br class=""><blockquote type="cite" class="">On 21 Jun 2016, at 21:43, Kenny Wyland via swift-evolution <<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>> wrote:<br class=""><br class="">Hi all,<br class=""><br class="">I'm new to the list and I just searched through the archives as best I could to see if someone else had already brought this up, but I didn't find anything. Forgive me if this horse has been beaten.<br class=""><br class="">I find that typing \(var) is very disruptive to my typing flow. The more I code in Swift, the more I like it, but every time I'm coding and then have to hiccup while typing \ then ( causes me to be annoyed. I know, it's minor, but it isn't a key combination that flows quickly.<br class=""><br class="">I would much rather have $() or perhaps ${} (like Groovy lang) or perhaps @() to go along with other uses of @ throughout the language.<span class="Apple-converted-space"> </span><br class=""><br class="">A shifted key, like $ or @, followed by another shifted key like (, allows for a much faster flow and they are much closer to the home keys than \ which is nearly as far from home keys as possible (and awkward).<span class="Apple-converted-space"> </span><br class=""><br class="">Thoughts?<br class=""><br class="">Kenny Wyland<br class=""><a href="http://inadaydevelopment.com/" class="">InADayDevelopment.com</a><br class=""></blockquote></div></div></blockquote><br class=""></div><div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">I have to disagree - The \ syntax is consistent with other string escape sequences (\n etc.) and reads naturally to me in that regard. Additionally, the \ is very visually distinctive in a string, much moreso than the "traditional" $ variable marker. Almost every language I’ve seen using $ for interpolation in strings is doing so because it also uses it as a variable prefix in non-string contexts. To top it off, using $ instead would, for me, just add yet another language for which I have to remember "does the $ go inside or outside the name delimiter braces/brackets/whatever?", "is it parenthesis, braces, brackets, or some other delimiter for variable names?", "what kind of expressions can I use in this context?", "can I use interpolation without any delimiters for simple cases?", etc. See also PHP, Perl, ten flavors of shell scripts, JavaScript, JSP/ASP, XPath, and so forth. The \() syntax is unique to Swift and therefore very easy to remember.</div></div></blockquote><br class=""></div><div>I agree with this; Swift’s only other dollar sign use is for closure shorthand variables, which is technically a non-string context but I assume you mean on *all* variables. Anyway, I think \() is actually a good way to do this, as it’s unambiguous, and not something you’re likely to type by mistake, since you don’t need to escape the brackets for any other purpose. The way I think of it is as an escape from the string, which is IMO more logical than a variable inside a string which dollar notation brings to mind (for me at least).</div></body></html>