Stream: announcements

Topic: new string interpolation syntax


view this post on Zulip Richard Feldman (Jan 08 2024 at 12:39):

the current nightly now includes the new string interpolation syntax discussed in #ideas > string interpolation syntax! It works the same way as before, except instead of \(…) it's now $(…)

For now, the previous syntax is still supported, and roc format will preserve whichever one you use, so this change is currently backwards-compatible. At some point in the future, roc format will automatically change the previous syntax to the new syntax, and eventually support previous syntax will be removed.

Ivan's VS Code extension supports the new syntax, including syntax highlighting for expressions inside the $(…)! :smiley:

Screenshot-2024-01-08-at-7.34.36-AM.png

view this post on Zulip Drew Lazzeri (Jan 08 2024 at 22:29):

The deprecated syntax is still present in the first example on the website, if you're making a list of places to update! I'd make a PR but haven't got set up fully yet :grinning:
Screen-Shot-2024-01-08-at-3.26.16-PM.png

view this post on Zulip Anton (Jan 09 2024 at 09:38):

Thanks for letting us now @Drew Lazzeri :)
I have a fix up in PR#6369


Last updated: Jul 26 2025 at 12:14 UTC