Stream: beginners

Topic: Desired string interpolation syntax


view this post on Zulip Vincent Van Dyck (Jul 09 2025 at 13:51):

Hello :wave:,

I'm currently enjoying exploring roc, and have a quick question about the syntax for string interpolation.

In the docs I'm seeing that the syntax looks like "Hello, ${name}".
In the interactive homepage demo visitors are asked to interpolate with syntax "Hello, $(name)".

I was wondering if both versions will always be supported, and/or if there is a preferred version.

Thanks!

view this post on Zulip Anton (Jul 09 2025 at 14:04):

I think $(name) is going away and ${name} will become the only way to do it

view this post on Zulip Anton (Jul 09 2025 at 14:05):

I'll update the homepage

view this post on Zulip Vincent Van Dyck (Jul 09 2025 at 14:06):

Thanks for replying! If you don't get around to it, I'll happily submit a PR later today or tomorrow

view this post on Zulip Anton (Jul 09 2025 at 14:08):

It's already in the oven :) #7981
Thanks for alerting us!

view this post on Zulip Vincent Van Dyck (Jul 09 2025 at 14:14):

Left a tiny comment to avoid blocking the flow of the interactive demo

view this post on Zulip Anton (Jul 09 2025 at 14:32):

Well spotted :)


Last updated: Jul 26 2025 at 12:14 UTC